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

feat: support axis/legend labelExpr + add example with month initials #5260

Merged
merged 11 commits into from
Aug 5, 2019

Conversation

kanitw
Copy link
Member

@kanitw kanitw commented Aug 4, 2019

Fix #5122
Fix #5249

@kanitw kanitw changed the title feat: support axis labelExpr + add example with month initials feat: support axis/legend labelExpr + add example with month initials Aug 5, 2019
src/axis.ts Outdated
@@ -185,6 +185,12 @@ export interface AxisOrientMixins {
export type AxisConfig = VlOnlyGuideConfig & AxisOrientMixins & VgAxisConfigNoSignals;

export interface Axis extends AxisOrientMixins, VgAxisConfigNoSignals, Guide {
/**
* Vega expression for customizing labels text.
* Note that the string label and value can be assessed via the `label` and `value` of the backing `datum` object.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Note that the string label and value can be assessed via the `label` and `value` of the backing `datum` object.
* Access the label text and value via the `label` and `value` of the `datum` object.

src/legend.ts Outdated
@@ -110,6 +110,12 @@ export interface Legend
*/
encoding?: LegendEncoding;

/**
* Vega expression for customizing labels text.
* Note that the string label and value can be assessed via the `label` and `value` of the backing `datum` object.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Note that the string label and value can be assessed via the `label` and `value` of the backing `datum` object.
* Access the label text and value via the `label` and `value` of the `datum` object.

test/compile/legend/assemble.test.ts Outdated Show resolved Hide resolved
test/compile/legend/assemble.test.ts Outdated Show resolved Hide resolved
test/compile/legend/assemble.test.ts Outdated Show resolved Hide resolved
test/compile/legend/assemble.test.ts Outdated Show resolved Hide resolved
kanitw and others added 8 commits August 5, 2019 10:50
Co-Authored-By: Dominik Moritz <domoritz@gmail.com>
Co-Authored-By: Dominik Moritz <domoritz@gmail.com>
Co-Authored-By: Dominik Moritz <domoritz@gmail.com>
Co-Authored-By: Dominik Moritz <domoritz@gmail.com>
@domoritz domoritz merged commit a4ee4ec into master Aug 5, 2019
@domoritz domoritz deleted the kw/axis.labelExpr branch August 5, 2019 18:23
@domoritz
Copy link
Member

Why didn't we add this for header?

@kanitw
Copy link
Member Author

kanitw commented Aug 22, 2019

Headers require different code and I can't think of a convincing use case for headers labelExpr to justify the implementation effort.

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

Successfully merging this pull request may close these issues.

Support "J F M A M J" as month labels Support expression for formatting axis
2 participants