[FEATURE]: line graphs with line color based on value
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript
- Bereich
- data-visualization
Rechercherichtung
Start with the scatter attributes in src/traces/scatter/attributes.js, the defaults in line_defaults.js, and gradientWithBounds in src/components/drawing/index.js. Review how fill gradients, legend icons, and image tests are handled, then resolve the proposed line.gradient API with maintainers. Done includes line rendering, reference images, a draftlogs/ changelog, and a rebuilt generated schema; scattergl is out of scope.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
Line graphs can have only one colour per series.
Sometime it is very useful to have the line colour variable based on value, to show visually ranges.
For example, I am using right now Apexcharts for energy prices and I obtain:
Why should this feature be added?
Provide information visually, without the need of reading values, which is useful when preparing graph which must be understood easily and also by less technical people.
I can open a PR if the feature is approved. It would be generated by LLM and tested myself.
Mocks/Designs
See screenshot above.
Notes
Related: https://github.com/plotly/plotly.js/issues/5259
This is Claude asked about the complexity of the implementation:
Area graphs: works today
Scatter traces have a fillgradient attribute (src/traces/scatter/attributes.js:387). Set it to type: 'vertical' and give start/stop in y-axis units. Colour scales accept the same position twice, so a scale can switch colour sharply instead of blending. That makes thresholds possible:
// thresholds 2 and 4, gradient spans y = 0..6
fillgradient: {
type: 'vertical', start: 0, stop: 6,
colorscale: [[0, base], [2/6, base], [2/6, 'orange'],
[4/6, 'orange'], [4/6, 'red'], [1, 'red']]
}
Lines and stepped lines: needs a new attribute
line.color takes one colour only. The drawing helper behind fillgradient (gradientWithBounds in src/components/drawing/index.js:462) can already colour a line instead of a fill. So the feature would mostly reuse existing code:
- New attributes: add them to the scatter line settings, plus their defaults in
line_defaults.js. - Drawing: call the existing helper on the line, in the same way the fill code does.
- Other pieces:
- the legend icon;
- image tests (a human must generate the reference images);
- a changelog file in
draftlogs/; - a rebuild of the generated schema.
It would work for all line shapes, including hv, vh, hvh, vhv and spline. It would not cover the WebGL version (scattergl), and stacked areas would be coloured by their stacked height.
For the settings, I suggest a line.gradient that copies fillgradient (type, start, stop, colorscale). That keeps the API consistent, and plotly.js puts consistency first. Your threshold list could be added on top of that as an easier way to write the stepped colour scale. The maintainers should decide on that part.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 18.4k
- Forks
- 2.1k
- Ø Merge
- 2 T. 16 Std.
- Gemergte PRs (30 T.)
- 11
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus plotly/plotly.js
-
[BUG]: `events` is required but not declared in dependenciesEvtl. vergeben @KoolADE85 hat das vor 6 Tagen übernommen. Offenbug P3 size: 1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
plotly/plotly.js#8163 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG]: `sankey`: `node.x` / `node.y` of `0` is ignoredEvtl. vergeben @adimalkar hat das vor 11 Tagen übernommen. Offenbug P3 size: 1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
plotly/plotly.js#8150 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG]: `scatterpolargl` drops points between 10000 and 100000 pointsEvtl. vergeben @Tanishdete333 hat das vor 11 Tagen übernommen. Offenbug P3 size: 1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
plotly/plotly.js#8148 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG]: findEmpties throws "iterated with no new neighbors" for large NaN regions in contour (double-precision underflow)Evtl. vergeben @davrens101 hat das vor 10 Tagen übernommen. Offenbug P3 size: 3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
plotly/plotly.js#8108 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
chore P3 plotly-internal size: 3 task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
plotly/plotly.js#8064 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in plotly/plotly.js
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
SasanLabs/VulnerableApp#912 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[chore]: Force minimatch 11.0.1 in the CI scripts' jest tooling (Dependabot #140)Evtl. vergeben @alishair7071 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
jaegertracing/jaeger#10133 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
accessibility
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
OREL-group/Project-Management#133 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
volcengine/OpenViking#7485 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag