-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Plotly.react #2341
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
Plotly.react #2341
Changes from all commits
54b6969
aab4f11
45c56b0
e58b74d
1074804
0548db3
698fa4f
3c56243
f01bab9
2fbd97c
f873b26
5aaa0df
7a3b075
5814642
8fbe06e
afc05c9
898c39d
e9270fc
414a9b8
e982ca1
b856ad8
88ad7f2
ade3cca
4b98be6
3178b2e
564dff6
be4932d
0752aa5
9ba4be9
9795b69
57c7d6c
3a11062
896471c
e12ce1b
46c6642
4197c32
f9d6151
c8a07e8
2a7d640
5d6a4a0
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 |
---|---|---|
|
@@ -20,7 +20,7 @@ module.exports = { | |
valType: 'boolean', | ||
role: 'info', | ||
dflt: true, | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
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. Can you clarify why we now need 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.
Here we're letting the user do their own editing, so there's much less of that complexity. So now I use 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. Very clear. Thanks 📚 |
||
description: [ | ||
'Determines whether or not this annotation is visible.' | ||
].join(' ') | ||
|
@@ -29,7 +29,7 @@ module.exports = { | |
text: { | ||
valType: 'string', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets the text associated with this annotation.', | ||
'Plotly uses a subset of HTML tags to do things like', | ||
|
@@ -42,14 +42,14 @@ module.exports = { | |
valType: 'angle', | ||
dflt: 0, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets the angle at which the `text` is drawn', | ||
'with respect to the horizontal.' | ||
].join(' ') | ||
}, | ||
font: fontAttrs({ | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
colorEditType: 'arraydraw', | ||
description: 'Sets the annotation text font.' | ||
}), | ||
|
@@ -58,7 +58,7 @@ module.exports = { | |
min: 1, | ||
dflt: null, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets an explicit width for the text box. null (default) lets the', | ||
'text set the box width. Wider text will be clipped.', | ||
|
@@ -70,7 +70,7 @@ module.exports = { | |
min: 1, | ||
dflt: null, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets an explicit height for the text box. null (default) lets the', | ||
'text set the box height. Taller text will be clipped.' | ||
|
@@ -131,7 +131,7 @@ module.exports = { | |
min: 0, | ||
dflt: 1, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets the padding (in px) between the `text`', | ||
'and the enclosing border.' | ||
|
@@ -142,7 +142,7 @@ module.exports = { | |
min: 0, | ||
dflt: 1, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets the width (in px) of the border enclosing', | ||
'the annotation `text`.' | ||
|
@@ -153,7 +153,7 @@ module.exports = { | |
valType: 'boolean', | ||
dflt: true, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Determines whether or not the annotation is drawn with an arrow.', | ||
'If *true*, `text` is placed near the arrow\'s tail.', | ||
|
@@ -198,7 +198,7 @@ module.exports = { | |
min: 0.3, | ||
dflt: 1, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets the size of the end annotation arrow head, relative to `arrowwidth`.', | ||
'A value of 1 (default) gives a head about 3x as wide as the line.' | ||
|
@@ -209,7 +209,7 @@ module.exports = { | |
min: 0.3, | ||
dflt: 1, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets the size of the start annotation arrow head, relative to `arrowwidth`.', | ||
'A value of 1 (default) gives a head about 3x as wide as the line.' | ||
|
@@ -219,15 +219,15 @@ module.exports = { | |
valType: 'number', | ||
min: 0.1, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: 'Sets the width (in px) of annotation arrow line.' | ||
}, | ||
standoff: { | ||
valType: 'number', | ||
min: 0, | ||
dflt: 0, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets a distance, in pixels, to move the end arrowhead away from the', | ||
'position it is pointing at, for example to point at the edge of', | ||
|
@@ -241,7 +241,7 @@ module.exports = { | |
min: 0, | ||
dflt: 0, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets a distance, in pixels, to move the start arrowhead away from the', | ||
'position it is pointing at, for example to point at the edge of', | ||
|
@@ -253,7 +253,7 @@ module.exports = { | |
ax: { | ||
valType: 'any', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets the x component of the arrow tail about the arrow head.', | ||
'If `axref` is `pixel`, a positive (negative) ', | ||
|
@@ -266,7 +266,7 @@ module.exports = { | |
ay: { | ||
valType: 'any', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets the y component of the arrow tail about the arrow head.', | ||
'If `ayref` is `pixel`, a positive (negative) ', | ||
|
@@ -333,7 +333,7 @@ module.exports = { | |
x: { | ||
valType: 'any', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets the annotation\'s x position.', | ||
'If the axis `type` is *log*, then you must take the', | ||
|
@@ -351,7 +351,7 @@ module.exports = { | |
values: ['auto', 'left', 'center', 'right'], | ||
dflt: 'auto', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets the text box\'s horizontal position anchor', | ||
'This anchor binds the `x` position to the *left*, *center*', | ||
|
@@ -370,7 +370,7 @@ module.exports = { | |
valType: 'number', | ||
dflt: 0, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Shifts the position of the whole annotation and arrow to the', | ||
'right (positive) or left (negative) by this many pixels.' | ||
|
@@ -396,7 +396,7 @@ module.exports = { | |
y: { | ||
valType: 'any', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets the annotation\'s y position.', | ||
'If the axis `type` is *log*, then you must take the', | ||
|
@@ -414,7 +414,7 @@ module.exports = { | |
values: ['auto', 'top', 'middle', 'bottom'], | ||
dflt: 'auto', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Sets the text box\'s vertical position anchor', | ||
'This anchor binds the `y` position to the *top*, *middle*', | ||
|
@@ -433,7 +433,7 @@ module.exports = { | |
valType: 'number', | ||
dflt: 0, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
editType: 'calcIfAutorange+arraydraw', | ||
description: [ | ||
'Shifts the position of the whole annotation and arrow up', | ||
'(positive) or down (negative) by this many pixels.' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,15 +18,13 @@ var helpers = require('./helpers'); | |
|
||
|
||
module.exports = function legendDefaults(layoutIn, layoutOut, fullData) { | ||
var containerIn = layoutIn.legend || {}, | ||
containerOut = layoutOut.legend = {}; | ||
var containerIn = layoutIn.legend || {}; | ||
var containerOut = {}; | ||
|
||
var visibleTraces = 0, | ||
defaultOrder = 'normal', | ||
defaultX, | ||
defaultY, | ||
defaultXAnchor, | ||
defaultYAnchor; | ||
var visibleTraces = 0; | ||
var defaultOrder = 'normal'; | ||
|
||
var defaultX, defaultY, defaultXAnchor, defaultYAnchor; | ||
|
||
for(var i = 0; i < fullData.length; i++) { | ||
var trace = fullData[i]; | ||
|
@@ -58,6 +56,8 @@ module.exports = function legendDefaults(layoutIn, layoutOut, fullData) { | |
|
||
if(showLegend === false) return; | ||
|
||
layoutOut.legend = containerOut; | ||
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. legend's visibility is controlled by 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. Very nice catch.
I'd vote +1 here. 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. added to #420 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.
so by default, in _fullLayout, the .legend key wouldn't be there? We could have a work around, but it's kind of one of the basic premises of widget visibility in the editor.. 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. @VeraZab you must not have been dependent on the existence of a |
||
|
||
coerce('bgcolor', layoutOut.paper_bgcolor); | ||
coerce('bordercolor'); | ||
coerce('borderwidth'); | ||
|
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.
FYI just added this so I could click through the list of mocks and not lose track of which one I'm on... Something I'd wanted to do for a long time but now that I'm trying to load EVERY mock in sequence it became important enough to actually implement.