Comments (11)
From Max:
Cytoscape.js uses the Weaver APIs for multitasking. Because of how webworkers work, you either have to keep multitasking code unminified or use a bit of extra reference fixing.
See the minification info and ref()
Ideally, CoSE should use _ref_()
so that clients don't have to worry about minification issues. Alternatively, not minifying the cose-bilkent.js
file should work around the issue.
from cytoscape.js-cose-bilkent.
Hi Danny, I hope you're not in urgent need of this getting fixed. We hope to address it in the future though.
from cytoscape.js-cose-bilkent.
Thanks for following up. No worries - I just prevent it from being minified and it works fine.
from cytoscape.js-cose-bilkent.
Also just ran into this issue. Would be interested if there was a workaround but happy to go unminified
from cytoscape.js-cose-bilkent.
The issue is the dependency tree of all of the classes.
Options:
(1) Remove all classes and instead use pure functions with plain objects. This is the ideal solution. It would greatly cut down on the file size and it would make it trivial to support minification. It would also make the algorithm itself run much faster.
(2) Remove all class dependencies. Probably not practical
(3) Don't use multitasking. The algorithm is already slower than the embedded CoSE, because it creates many class instances on every iteration of the algorithm -- so maybe multitasking doesn't matter that much.
from cytoscape.js-cose-bilkent.
awesome news! I was gonna test it out but i'm wondering if maybe I'm building it wrong or if latest npm package is configured weird
I tried adding cytoscape-cose-bilkent and cytoscape latest versions and building with gulp but got an error
example
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var browserify = require('gulp-browserify');
gulp.task('build', function () {
gulp.src(['index.js'])
.pipe(browserify())
.pipe(uglify())
.pipe(gulp.dest('dist'));
return 1;
});
gulp.task('default', ['build']);
var cycose = require('cytoscape-cose-bilkent')
var cytoscape = require('cytoscape')
cycose(cytoscape)
gulp
[17:39:27] Using gulpfile ~/test2/gulpfile.js
[17:39:27] Starting 'build'...
[17:39:27] Finished 'build' after 14 ms
[17:39:27] Starting 'default'...
[17:39:27] Finished 'default' after 47 μs
events.js:161
throw er; // Unhandled 'error' event
^
Error: module "./FDLayoutConstants" not found from "/Users/me/test2/node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js"
at notFound (/Users/me/test2/node_modules/browserify/index.js:803:15)
at /Users/me/test2/node_modules/browserify/index.js:754:23
at /Users/me/test2/node_modules/browser-resolve/index.js:185:24
at /Users/me/test2/node_modules/browser-resolve/node_modules/resolve/lib/async.js:36:22
at load (/Users/me/test2/node_modules/browser-resolve/node_modules/resolve/lib/async.js:54:43)
at /Users/me/test2/node_modules/browser-resolve/node_modules/resolve/lib/async.js:60:22
at /Users/me/test2/node_modules/browser-resolve/node_modules/resolve/lib/async.js:16:47
at FSReqWrap.oncomplete (fs.js:114:15)
➜ test git:(master) ✗ cat Gulpfile.js
from cytoscape.js-cose-bilkent.
It builds fine on my machine. You don't have to build anyway. main
points to the prebuilt file
from cytoscape.js-cose-bilkent.
I'm wondering if maybe it is hardcoding paths to your computer? This is the top of cytoscape-cose-bilkent.js
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"/Users/max/Documents/workspace/cytoscape.js-cose-bilkent/src/Layout/CoSEConstants.js":[function(require,module,exports){
var FDLayoutConstants = require('./FDLayoutConstants');
function CoSEConstants() {
}
//CoSEConstants inherits static props in FDLayoutConstants
for (var prop in FDLayoutConstants) {
CoSEConstants[prop] = FDLayoutConstants[prop];
}
CoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING = false;
CoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH;
CoSEConstants.DEFAULT_COMPONENT_SEPERATION = 60;
module.exports = CoSEConstants;
},{"./FDLayoutConstants":"/Users/max/Documents/workspace/cytoscape.js-cose-bilkent/src/Layout/FDLayoutConstants.js"}],"/Users/max/Documents/workspace/cytoscape.js-cose-bilkent/src/Layout/CoSEEdge.js":[function(require,module,exports){
var FDLayoutEdge = require('./FDLayoutEdge');
from cytoscape.js-cose-bilkent.
Try 1.4.1
It just points main
to ./src
It's better for bundlers like Browserify and Webpack, anyway
from cytoscape.js-cose-bilkent.
@maxkfranz that seems like it builds now! I get an error at runtime though...trying to create minimal example, maybe I'll make a new issue!
rhill-voronoi-core.js:1721 Uncaught ReferenceError: Point is not defined
at CoSELayout.positionNodesRadially (rhill-voronoi-core.js:1721)
at CoSELayout.classicLayout (rhill-voronoi-core.js:1721)
at CoSELayout.layout (rhill-voronoi-core.js:1721)
at CoSELayout.Layout.runLayout (rhill-voronoi-core.js:1721)
at run (rhill-voronoi-core.js:1721)
at Layout._CoSELayout.run (rhill-voronoi-core.js:1721)
at Core.layout (rhill-voronoi-core.js:1721)
at Core.load (rhill-voronoi-core.js:1721)
at rhill-voronoi-core.js:1721
at loadExtData (rhill-voronoi-core.js:1721)
from cytoscape.js-cose-bilkent.
@cmdcolin OK, looking forward to the test case
from cytoscape.js-cose-bilkent.
Related Issues (20)
- Graph nodes not laid out properly HOT 4
- Can a point have two parent nodes?
- Uncaught TypeError: ani.play is not a function HOT 3
- how to set node size from data? HOT 3
- "ReferenceError: self is not defined" error occurring in unstable branch HOT 2
- Uncaught TypeError: Cannot read property 'getParent' of undefined HOT 9
- Cytoscape 3.3 objects in Vue.js state cause endless recursion HOT 12
- Possible to create a planar graph? HOT 5
- Is there a way to keep the nodes on a single Y axis? HOT 1
- Multiple groups of nodes are distributed HOT 3
- Setting nodeDimensionsIncludeLabels to true works not well for zero degree nodes HOT 4
- v4.1.0 has breaking changes to v4.0 HOT 4
- Uniform node dimensions HOT 1
- Pack disconnected graph components using new utility
- Incremental tiling
- Seed for deterministic layout HOT 4
- Retain node positions when chart is being re-generated with the same dataset HOT 3
- Tree reduction during incremental layout
- Update License HOT 2
- fit not working with huge amount of data HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cytoscape.js-cose-bilkent.