cytoscape / cytoscape.js

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

Node flags #3164

Open danprince opened 1 year ago

danprince commented 1 year ago

Description of new feature

What should the new feature do? For visual features, include an image/mockup of the expected output.

Flags would be a new Cytoscape decoration that allowed nodes to visualise multiple value fields with a set of colors around the outside of the node.

image

This would involve adding the following style properties to Cytoscape.js.

There are two additional properties which might make sense to add here too.

image

Additional considerations

It might also be worth considering a syntax which explicitly maps from values to colors, to reduce ambiguity around which value will be assigned to which color.

flag-property: "tags";
flag-colors: "foo" "red", "bar" "green", "baz" "yellow";
/* nodes where `data("tags").includes("foo")` will get a "red" flag. */

It's also worth clearly acknowledging that this is a similar feature to the pie styles mentioned here, but takes a different approach that involves enumerating the values and mapping them to a palette, rather than coding a fixed number of slices statically.

Edge cases

Motivation for new feature

Describe your use case for this new feature.

Given a set of nodes where each node has a multiple value property, flags enable quick scannable visualisation of the presence of values on each element. Here's some example data:

{
  nodes: [
    { data: { id: "java", tags: ["static", "jvm", "imperative"] } },
    { data: { id: "scala", tags: ["static", "functional", "jvm"] } },
    { data: { id: "clojure", tags: ["dynamic", "functional", "jvm"] } },
  ]
}

And here's a suggestion for how flag styles would work:

[tags] {
  flag-property: "tags";
  flag-colors: "red", "green", "blue", "cyan", "magenta", "yellow";
}

And a mockup for how they'd look:

image

As additional context, here's some of the language and framing we've used for introducing Kumu users to flags.

For reviewers

Reviewers should ensure that the following tasks are carried out for incorporated issues:

maxkfranz commented 1 year ago

@danprince, do you want to schedule a call to discuss some of these issues in more detail? I'm offline this upcoming week, so we could schedule something for the subsequent week. My email is maxkfranz@gmail.com.

danprince commented 1 year ago

Thanks! Replied by email.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale, because it has not had activity within the past 14 days. It will be closed if no further activity occurs within the next 7 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale, because it has not had activity within the past 14 days. It will be closed if no further activity occurs within the next 7 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions.

maxkfranz commented 1 year ago

Summary of previous discussions:

maxkfranz commented 8 months ago

@danprince, do you have an ETA for the PRs for the prior features?

danprince commented 8 months ago

Hey @maxkfranz, afraid we're still catching up on work from the end of last year without a ton of breathing room at the moment.

I can drop you a line when we've got some space again, but it's definitely not going to be in the next few weeks.

maxkfranz commented 8 months ago

@danprince

I'll keep these issues pinned, and I'll keep an eye out for your upcoming email.