-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
add 'tickformatstops' #1965
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
add 'tickformatstops' #1965
Changes from 1 commit
1baa14a
f958c3b
a155bd9
be11c03
a13c29e
304d96b
0c9fb2b
db526d9
7f1fd41
86777f7
531aea8
0b48a33
6420044
92f7c13
df72531
7665b4c
0e6747f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ module.exports = function handleTickLabelDefaults(containerIn, containerOut, coe | |
|
||
if(axType !== 'category') { | ||
var tickFormat = coerce('tickformat'); | ||
coerce('tickformatstops'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not category? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... also, you'll need to a little more work coercing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, {
ticktext: [/* */],
tickvals: [/* */]
} just like regular axis-level The range of each My apologies, I thought I had written that down somewhere before 😏 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No problem, but not sure that I got everything right :) I have the following categories: then I define
and as result I get only 2 ticks: Is it correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @apalchys There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @talgalili I see what you say but not sure how to fit it into the proposed API. I am quite new in Plotly community. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @apalchys checking about this further with @cpsievert - it appears that what I'm looking for is
(see the discussion here: talgalili/heatmaply#78 (comment) ) Is there a way the current work would be extended to deal with this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll try to think some more about this issue at some point this week. Sorry for the wait. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @etpinard have you had a chance to look into it? |
||
if(!tickFormat && axType !== 'date') { | ||
coerce('showexponent', showAttrDflt); | ||
coerce('exponentformat'); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -265,6 +265,18 @@ module.exports = { | |
'*%H~%M~%S.%2f* would display *09~15~23.46*' | ||
].join(' ') | ||
}, | ||
tickformatstops: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you mind DRYing this up by adding var axesAttrs = require('../../plots/cartesian/layout_attributes')
// ....
tickformatstops: axesAtttrs.tickformatstops,
// ... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed, thanks. |
||
valType: 'any', | ||
arrayOk: true, | ||
role: 'style', | ||
description: [ | ||
'Set rules for customizing tickformat on different zoom levels for *date* and', | ||
'*linear axis types. You can specify these rules in following way', | ||
'[{dtickrange: [*min*, *max*], value: *format*}]. Where *min*, *max* - dtick values', | ||
'which describe some zoom level, it is possible to omit *min* or *max* value by passing', | ||
'*null*. *format* - string, exactly as *tickformat*' | ||
].join(' ') | ||
}, | ||
categoryorder: { | ||
valType: 'enumerated', | ||
values: [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ module.exports = transformTools.makeRequireTransform('requireTransform', | |
var pathOut; | ||
|
||
if(pathIn === 'd3' && opts.file !== pathToStrictD3Module) { | ||
pathOut = 'require(\'' + pathToStrictD3Module + '\')'; | ||
pathOut = 'require(\'' + pathToStrictD3Module.replace(/\\/g, '/') + '\')'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need it for windows users. I've updated the code and added comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! |
||
} | ||
|
||
if(pathOut) return cb(null, pathOut); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do better here.
See for example the
layout.slider
declaration here. Thesteps
array container is declared using the ✨ special ✨_isLinkedToArray
.So, this here should look like: