Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Responsive Ordinal Scale (Ordinal Fit Mode) #194

Closed
4 tasks
kanitw opened this issue Feb 4, 2015 · 8 comments
Closed
4 tasks

Responsive Ordinal Scale (Ordinal Fit Mode) #194

kanitw opened this issue Feb 4, 2015 · 8 comments
Assignees
Milestone

Comments

@kanitw
Copy link
Member

kanitw commented Feb 4, 2015

Currently config.cell.width, config.cell.height are ignored for x and y if they ordinal scales respectively.
Basically, the cell width and height of an ordinal scale is determined by the band size * cardinality.

  • Let's add config.unit.fitOrdinalScale as boolean to make the ordinal scale rely on the config.unit.width/height value instead of bandWidth. See below
  • Need to deal make the scale work with all mark type.
  • corner case when the cardinality of the ordinal field is too high
  • Of course, add tests.
@kanitw kanitw added this to the Nice to have (after 1.0) milestone Feb 4, 2015
@kanitw kanitw modified the milestones: Nice to have, x.x (Should Have Later) May 24, 2015
@kanitw kanitw modified the milestones: 1.0, x.x (Should Have Later), 0.9.0 Stabilize API & Core Syntax, 0.10 Optimizing Vega Output Nov 20, 2015
@kanitw kanitw modified the milestones: 1.x Should have after 1.0 , 0.10.x Optimizing Vega Output, 1.0 Dec 1, 2015
@kanitw kanitw modified the milestones: 1.0, 1.0? Dec 15, 2015
@kanitw kanitw self-assigned this Jan 11, 2016
@kanitw kanitw added this to the 1.0 milestone Jan 11, 2016
@kanitw kanitw modified the milestones: 1.x Features, 1.x.x Patches & Minor Features Jan 12, 2016
@kanitw kanitw removed the Need Clarification ❔ Needs clarification before we can proceed. label Jan 13, 2016
@kanitw kanitw mentioned this issue Feb 3, 2016
3 tasks
@kanitw kanitw changed the title Simplify Layout / Make Layout Responsive Responsive Ordinal Scale (Ordinal Fit Mode) Feb 7, 2016
@kanitw
Copy link
Member Author

kanitw commented Mar 2, 2016

config.unit.fitOrdinalScale sounds confusing.

One possible way to make a readable syntax is the allow scale.bandWidth to be "fit" besides number.

@domoritz thoughts?

@domoritz
Copy link
Member

domoritz commented Mar 2, 2016

scale.bandWidth with fit sounds much better.

@kanitw
Copy link
Member Author

kanitw commented Jul 11, 2016

Earlier, we planned to allow scale.bandWidth to be "fit" to support ordinal scale fit.

Here I'm extending my thinking to #1421 (support width and height at the top-level).

  1. If top-level width is provided, always use it (fit ordinal scale to width no matter scale.bandWidth is explicitly specified or not.)
  2. else (If top-level width is not provided):
  • For non-ordinal scale always use config.cell.width.
  • For ordinal scale:
  • If scale.bandSize is not "fit" (default = not fit), use bandSize * cardinality. -- Note that this is the default because it doesn't break with high cardinality.
  • If scale.bandSize is "fit", use config.cell.width and fit the scale.

(Same logic for height)

@domoritz @jheer what do you think?

@kanitw
Copy link
Member Author

kanitw commented Jul 11, 2016

(Just clarified the comment above after conversation with @arvind, who agrees with the proposal.)

@kanitw kanitw modified the milestones: 1.0.x Important Patches, 1.2 Sizing Jul 12, 2016
@kanitw
Copy link
Member Author

kanitw commented Jul 31, 2016

Done in #1214, pending docs revisions and should be ready for merging.

@kanitw kanitw closed this as completed Jul 31, 2016
@devgru
Copy link
Contributor

devgru commented Nov 29, 2017

Looks like in vega-lite 2.0.1 this feature is removed?

@domoritz
Copy link
Member

domoritz commented Nov 29, 2017

Looks like in vega-lite 2.0.1 this feature is removed?

It's been improved. Docs are at https://vega.github.io/vega-lite/docs/size.html.

@kanitw
Copy link
Member Author

kanitw commented Nov 29, 2017

It is now called rangeStep, which is a bit more precise name. Basically, bandwidth supposes to be a fraction of range step. See https://vega.github.io/vega-lite/docs/scale.html#band for illustration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants