Git Product home page Git Product logo

cytoscape-css-renderer's People

Contributors

wehriam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cytoscape-css-renderer's Issues

Zoom in and label texts become blurred

Before zooming in:

image

After zooming in:

image

I understand that it's because the font size is not changed but scaled by CSS transformation. I can't think of a proper solution immediately, but it's really an issue for end users.

Extension inherits from renderer; better to be decoupled

Instead of inheriting from the renderer, it would be more flexible to have this extension decoupled. The renderer may change in future, and there is also a concern with performance: drawNodeText() is synchronous.

That means that doing the DOM manipulation will hold up redraws(), thereby slowing down the "rendering loop" (not quite how it works, but the principle is the same). It would probably be faster to poll using timeouts, and update the labels then. There may be a slight lag in the labels, but that would be an acceptable tradeoff for performance.

Handling zoom events

In order to achieve maximum balance of performance and text quality, it is best to use the scale() transform during zooming, and then to use an adjusted font size along with scale(1, 1) when zooming is finished. That way, text is crisp when zooming is finished, and text is rendered quickly during zooming. You can use $$.util.debounce() on the zoom event for this.

Labels are not correctly positioned for the official "Compound nodes" demo

Labels are not correctly positioned for the official "Compound nodes" demo ( http://js.cytoscape.org/#demos ). One would get something like:

image

Observations:

  • a little right
  • the parent nodes(which used {'text-valign': 'top', 'text-halign': 'center'}) are not on the top but centered

The code always assumed a width of 200px and calculates alignments based on that.

If we remove the codes handling alignments , it's actually a little better:

image

Maybe better to be ele.cssLabel() ext than a renderer

Along the same lines as #1, it may be better to be an element extension (i.e. function). That way, you can say explicitly which elements you want to use this. It also means that you can safely turn off regular labels using a bypass style (i.e. ele.css('min-zoomed-font-size', 9999999). Then you can read other label style properties as normal to render the labels with CSS.

Node hidden but html labels remain visible

The renderer does a good job of displaying html content on node and edge labels but when a node is hidden by the user, the labels remain visible for some reason.
I cannot understand what might be causing this problem.

Reading private ele data is OK, but renderer data is not

Reading private element data is fine and necessary. However, I would be hesitant to read private renderer data, as compatibility could easily break with changes to the renderer. Consider that the renderer could be subject to refactoring, API changes, changes in rendering technology, etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.