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

adding layout.colorway #2156

Merged
merged 4 commits into from Nov 15, 2017

Conversation

Projects
None yet
2 participants
@cixzhang
Copy link
Contributor

cixzhang commented Nov 13, 2017

For #2136

This PR adds the layout.colorway attribute which takes a list of colors to use as the default set of colors for all traces. By default, it should use the existing Color.defaults.

@cixzhang cixzhang referenced this pull request Nov 13, 2017

Open

adding layout.colorway #2

@etpinard

This comment has been minimized.

Copy link
Member

etpinard commented Nov 13, 2017

To add the baseline corresponding to your new mock, see

https://github.com/plotly/plotly.js/blob/master/test/image/README.md#c-generate-or-update-existing-baseline-image

If you're having issues with our docker image-test container, let us know.

valType: 'colorlist',
dflt: colorAttrs.defaults,
role: 'style',
editType: 'calc',

This comment has been minimized.

Copy link
@etpinard

etpinard Nov 13, 2017

Member

Comment for future development: note here that only pie traces require this to be editType: 'calc'. For most trace types, editType: 'plot' would have sufficed and even editType: 'style' might have been good enough for cartesian traces. Oh well, we might have to add-trace-type-specific editType flags for layout attributes down the road to improve performance.

@etpinard
Copy link
Member

etpinard left a comment

@cixzhang looks great. I'm glad you were able to generate the baseline.

I noticed a few things while making what I thought would be a final review.

Sorry for not noticing them sooner 😏

"labels": ["a","b","c","c","c","a","d","e","f","f","g","h"],
"type": "pie",
"domain": {"x": [0, 0.4]},
"xaxis": "x2",

This comment has been minimized.

Copy link
@etpinard

etpinard Nov 14, 2017

Member

xaxis and yaxis don't do anything for pie traces. Would you mind 🔪 them?

"domain": [0.4, 1]
},
"yaxis": {
"anchor": "y2"

This comment has been minimized.

Copy link
@etpinard

etpinard Nov 14, 2017

Member

anchor for y-axes expects x-axis ids, so this thing here gets ignored. 🔪

@@ -141,6 +141,22 @@ exports.valObjectMeta = {
else propOut.set(dflt);
}
},
colorlist: {

This comment has been minimized.

Copy link
@etpinard

etpinard Nov 14, 2017

Member

Would you mind adding a Lib.validate test case for the new colorlist valType?

@etpinard

This comment has been minimized.

Copy link
Member

etpinard commented Nov 15, 2017

A very lovely addition ❤️

Thanks very much @cixzhang 🎉

@etpinard etpinard merged commit 51fcb2e into plotly:master Nov 15, 2017

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@etpinard etpinard referenced this pull request Nov 15, 2017

Closed

Setting default colors #2136

@jonmmease jonmmease referenced this pull request Jan 31, 2018

Closed

WIP: adding themes #924

0 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.