Giter VIP home page Giter VIP logo

Comments (4)

hydrosquall avatar hydrosquall commented on August 22, 2024

From a code dive, it looks like discrete gradient legend is already reading the length param. However, it is not having a (visible) effect on the height of the legend.

This FR could be reclassified as a bugfix if the resolution is to wire the existing gradientLegend param into the discrete gradient legend.

https://github.com/vega/vega/blob/8a7f2f233b7fec430e52fbe19a544c1f290be591/packages/vega-parser/src/parsers/guides/legend-gradient-discrete.js#L13

from vega-lite.

domoritz avatar domoritz commented on August 22, 2024

Yeah, sounds like a bug fix.

from vega-lite.

hydrosquall avatar hydrosquall commented on August 22, 2024

After running local tests (I hardcoded a value into guide-util.js and checked the test specs for legends-discrete, this is a bug for vega-lite rather than vega .

Vega respects the gradientLength if there was is one passed in. The Vega-Lite specs are losing gradientLength at compile time, not at runtime.

Custom size (120) Default size (300)
image image

from vega-lite.

hydrosquall avatar hydrosquall commented on August 22, 2024

I figured out a runtime fix, which I'll push shortly. The deeper conceptual question which might lead to a change back in vega is whether Discrete

https://github.com/vega/vega/blob/8a7f2f233b7fec430e52fbe19a544c1f290be591/packages/vega-parser/src/parsers/guides/constants.js#L25-L27

should be exported as a 3rd LegendType,

or if discrete should be classified as a special mode within gradient instead of as a mode under symbol.

from vega-lite.

Related Issues (20)

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.