cytoscape / cytoscape.js

Graph theory (network) library for visualisation and analysis
https://js.cytoscape.org
MIT License
10.13k stars 1.64k forks source link

Cytoscape v4 -- planning for breaking API changes #2019

Open maxkfranz opened 7 years ago

maxkfranz commented 7 years ago

Brainstorming of improvements that would cause breaking changes for a potential, future v4:

Modernising:

Improving formatting & naming:

Improved defaults:

Removing deprecated features & other mistakes:

Moving features to external extensions or libraries:

pmackay commented 6 years ago

ele.json() returns classes as an array

Does this mean that it would include classes as well as other data?

Is there any way currently to get the list of classes an element has?

maxkfranz commented 6 years ago

Does this mean that it would include classes as well as other data?

classes: ['foo', 'bar'] versus classes: 'foo bar'

Is there any way currently to get the list of classes an element has?

ele.json().classes

StevenLangbroek commented 6 years ago

Since a class is a concept in Javascript now, maybe it's better to use classNames? Ecosystem seems to be standardising on this.

maxkfranz commented 6 years ago

Yes, but that wouldn't have to be a breaking (v4) change. The old key could still be supported.

Edit: We may want to use ele.classNames() with the ideal signature in v3 and then in v4 make a breaking change so that ele.classes() matches ele.classNames(). See #2110

maxkfranz commented 4 years ago

This issue is for discussing v4 API -- i.e. breaking API changes. If you have a general feature in mind that is additive w.r.t. API, then feel free to make an ordinary feature request and the corresponding pull request.