-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
restyle/relayout refactor #1999
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
Merged
Merged
Changes from 30 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
4d3e2ec
test - and fix - most of the relayout doextras
alexcjohnson 95d7d71
test - and fix - most of the doextra calls in restyle
alexcjohnson 3326ecc
test that xaxis-only items are only in the xaxis in the schema
alexcjohnson a948cce
merge component attribute schemas into core at register time
alexcjohnson dd52922
fix lib test for undefined -> null in undoqueue
alexcjohnson f90f079
abstract id/name counter regex and standardize cartesian attrRegex
alexcjohnson e036fea
fix #1325 - animating multiple axes
alexcjohnson 69e0188
Plotschema getTraceValObject and getLayoutValObject methods
alexcjohnson bbfe399
relativeAttr
alexcjohnson 29931ec
fix annotation comments/descriptions
alexcjohnson fad72a2
make common hover label pick up changes quicker
alexcjohnson e895b32
edit_types.overrideAll
alexcjohnson 7a7dc6d
let PlotSchema.crawl report the complete attribute string
alexcjohnson c87b01a
better reporting from hover label test
alexcjohnson 658e5cb
fix registry for new circular dep
alexcjohnson f49ae5e
massive commit to lock in editType and impliedEdits and clean up rest…
alexcjohnson 7ea0d25
lint
alexcjohnson 284c87f
remove obsolete comment in gl3d
alexcjohnson b9826c8
change overrideAll API to nested/from-root only
alexcjohnson 7c38a4a
clean up restyle/relayout flag names
alexcjohnson 96cc57f
clean up editTypes/impliedEdits and formalize & document their schema…
alexcjohnson cb94e95
test restrictions on component xaxis/yaxis schemas
alexcjohnson 238e248
preserve impliedEdits: {key: undefined} by extendDeepAll
alexcjohnson 42662ba
comments on relative_attr regexps
alexcjohnson 50aa1ca
include schema in dist
alexcjohnson 62a1392
fix plotschema test for metaKeys
alexcjohnson 87b26d5
test order-independence of trace/transform/component registration
alexcjohnson 040ed1b
test colorbar editing
alexcjohnson 388a7fe
abstract - and fix - automatic axis type clearing
alexcjohnson 6e8a68c
coerceTraceIndices earlier so clearAxisTypes can use it
alexcjohnson 4f8fc66
move clearAxisTypes into helpers
alexcjohnson 97ddf48
update jsdom to v11.2 with new API
alexcjohnson fe7db79
oops didn't mean to commit that commented out...
alexcjohnson 68f5dbc
fix and test errorbar visibility toggling
alexcjohnson d15e541
layout.showlegend test
alexcjohnson 7ec1634
closes #615 - something else in this PR fixed it, just nailing a test
alexcjohnson a107466
fix #358 - restyling orientation
alexcjohnson 42805c2
test histogram changing data type
alexcjohnson 8d9feaf
fix #2020 - editing plots with multiple histograms
alexcjohnson 0a98a6d
lint
alexcjohnson e4227aa
move checkTicks into custom_assertions
alexcjohnson 0729921
load custom_matchers globally, and refactor negateIf as a method
alexcjohnson 407ae5a
pull custom_matchers out of requirejs bundle test
alexcjohnson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
var ARROWPATHS = require('./arrow_paths'); | ||
var fontAttrs = require('../../plots/font_attributes'); | ||
var cartesianConstants = require('../../plots/cartesian/constants'); | ||
var extendFlat = require('../../lib/extend').extendFlat; | ||
|
||
|
||
module.exports = { | ||
|
@@ -21,6 +20,7 @@ module.exports = { | |
valType: 'boolean', | ||
role: 'info', | ||
dflt: true, | ||
editType: 'calcIfAutorange', | ||
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. <3 |
||
description: [ | ||
'Determines whether or not this annotation is visible.' | ||
].join(' ') | ||
|
@@ -29,6 +29,7 @@ module.exports = { | |
text: { | ||
valType: 'string', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets the text associated with this annotation.', | ||
'Plotly uses a subset of HTML tags to do things like', | ||
|
@@ -41,19 +42,23 @@ module.exports = { | |
valType: 'angle', | ||
dflt: 0, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets the angle at which the `text` is drawn', | ||
'with respect to the horizontal.' | ||
].join(' ') | ||
}, | ||
font: extendFlat({}, fontAttrs, { | ||
font: fontAttrs({ | ||
editType: 'calcIfAutorange', | ||
colorEditType: 'arraydraw', | ||
description: 'Sets the annotation text font.' | ||
}), | ||
width: { | ||
valType: 'number', | ||
min: 1, | ||
dflt: null, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets an explicit width for the text box. null (default) lets the', | ||
'text set the box width. Wider text will be clipped.', | ||
|
@@ -65,6 +70,7 @@ module.exports = { | |
min: 1, | ||
dflt: null, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets an explicit height for the text box. null (default) lets the', | ||
'text set the box height. Taller text will be clipped.' | ||
|
@@ -76,13 +82,15 @@ module.exports = { | |
max: 1, | ||
dflt: 1, | ||
role: 'style', | ||
editType: 'arraydraw', | ||
description: 'Sets the opacity of the annotation (text + arrow).' | ||
}, | ||
align: { | ||
valType: 'enumerated', | ||
values: ['left', 'center', 'right'], | ||
dflt: 'center', | ||
role: 'style', | ||
editType: 'arraydraw', | ||
description: [ | ||
'Sets the horizontal alignment of the `text` within the box.', | ||
'Has an effect only if `text` spans more two or more lines', | ||
|
@@ -95,6 +103,7 @@ module.exports = { | |
values: ['top', 'middle', 'bottom'], | ||
dflt: 'middle', | ||
role: 'style', | ||
editType: 'arraydraw', | ||
description: [ | ||
'Sets the vertical alignment of the `text` within the box.', | ||
'Has an effect only if an explicit height is set to override', | ||
|
@@ -105,12 +114,14 @@ module.exports = { | |
valType: 'color', | ||
dflt: 'rgba(0,0,0,0)', | ||
role: 'style', | ||
editType: 'arraydraw', | ||
description: 'Sets the background color of the annotation.' | ||
}, | ||
bordercolor: { | ||
valType: 'color', | ||
dflt: 'rgba(0,0,0,0)', | ||
role: 'style', | ||
editType: 'arraydraw', | ||
description: [ | ||
'Sets the color of the border enclosing the annotation `text`.' | ||
].join(' ') | ||
|
@@ -120,6 +131,7 @@ module.exports = { | |
min: 0, | ||
dflt: 1, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets the padding (in px) between the `text`', | ||
'and the enclosing border.' | ||
|
@@ -130,6 +142,7 @@ module.exports = { | |
min: 0, | ||
dflt: 1, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets the width (in px) of the border enclosing', | ||
'the annotation `text`.' | ||
|
@@ -140,6 +153,7 @@ module.exports = { | |
valType: 'boolean', | ||
dflt: true, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Determines whether or not the annotation is drawn with an arrow.', | ||
'If *true*, `text` is placed near the arrow\'s tail.', | ||
|
@@ -149,6 +163,7 @@ module.exports = { | |
arrowcolor: { | ||
valType: 'color', | ||
role: 'style', | ||
editType: 'arraydraw', | ||
description: 'Sets the color of the annotation arrow.' | ||
}, | ||
arrowhead: { | ||
|
@@ -157,26 +172,33 @@ module.exports = { | |
max: ARROWPATHS.length, | ||
dflt: 1, | ||
role: 'style', | ||
editType: 'arraydraw', | ||
description: 'Sets the annotation arrow head style.' | ||
}, | ||
arrowsize: { | ||
valType: 'number', | ||
min: 0.3, | ||
dflt: 1, | ||
role: 'style', | ||
description: 'Sets the size (in px) of annotation arrow head.' | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets the size of the annotation arrow head, relative to `arrowwidth`.', | ||
'A value of 1 (default) gives a head about 3x as wide as the line.' | ||
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 📚 |
||
].join(' ') | ||
}, | ||
arrowwidth: { | ||
valType: 'number', | ||
min: 0.1, | ||
role: 'style', | ||
description: 'Sets the width (in px) of annotation arrow.' | ||
editType: 'calcIfAutorange', | ||
description: 'Sets the width (in px) of annotation arrow line.' | ||
}, | ||
standoff: { | ||
valType: 'number', | ||
min: 0, | ||
dflt: 0, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets a distance, in pixels, to move the arrowhead away from the', | ||
'position it is pointing at, for example to point at the edge of', | ||
|
@@ -188,6 +210,7 @@ module.exports = { | |
ax: { | ||
valType: 'any', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets the x component of the arrow tail about the arrow head.', | ||
'If `axref` is `pixel`, a positive (negative) ', | ||
|
@@ -200,6 +223,7 @@ module.exports = { | |
ay: { | ||
valType: 'any', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets the y component of the arrow tail about the arrow head.', | ||
'If `ayref` is `pixel`, a positive (negative) ', | ||
|
@@ -217,6 +241,7 @@ module.exports = { | |
cartesianConstants.idRegex.x.toString() | ||
], | ||
role: 'info', | ||
editType: 'calc', | ||
description: [ | ||
'Indicates in what terms the tail of the annotation (ax,ay) ', | ||
'is specified. If `pixel`, `ax` is a relative offset in pixels ', | ||
|
@@ -234,6 +259,7 @@ module.exports = { | |
cartesianConstants.idRegex.y.toString() | ||
], | ||
role: 'info', | ||
editType: 'calc', | ||
description: [ | ||
'Indicates in what terms the tail of the annotation (ax,ay) ', | ||
'is specified. If `pixel`, `ay` is a relative offset in pixels ', | ||
|
@@ -251,6 +277,7 @@ module.exports = { | |
cartesianConstants.idRegex.x.toString() | ||
], | ||
role: 'info', | ||
editType: 'calc', | ||
description: [ | ||
'Sets the annotation\'s x coordinate axis.', | ||
'If set to an x axis id (e.g. *x* or *x2*), the `x` position', | ||
|
@@ -263,6 +290,7 @@ module.exports = { | |
x: { | ||
valType: 'any', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets the annotation\'s x position.', | ||
'If the axis `type` is *log*, then you must take the', | ||
|
@@ -280,6 +308,7 @@ module.exports = { | |
values: ['auto', 'left', 'center', 'right'], | ||
dflt: 'auto', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets the text box\'s horizontal position anchor', | ||
'This anchor binds the `x` position to the *left*, *center*', | ||
|
@@ -298,6 +327,7 @@ module.exports = { | |
valType: 'number', | ||
dflt: 0, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Shifts the position of the whole annotation and arrow to the', | ||
'right (positive) or left (negative) by this many pixels.' | ||
|
@@ -310,6 +340,7 @@ module.exports = { | |
cartesianConstants.idRegex.y.toString() | ||
], | ||
role: 'info', | ||
editType: 'calc', | ||
description: [ | ||
'Sets the annotation\'s y coordinate axis.', | ||
'If set to an y axis id (e.g. *y* or *y2*), the `y` position', | ||
|
@@ -322,6 +353,7 @@ module.exports = { | |
y: { | ||
valType: 'any', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets the annotation\'s y position.', | ||
'If the axis `type` is *log*, then you must take the', | ||
|
@@ -339,6 +371,7 @@ module.exports = { | |
values: ['auto', 'top', 'middle', 'bottom'], | ||
dflt: 'auto', | ||
role: 'info', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Sets the text box\'s vertical position anchor', | ||
'This anchor binds the `y` position to the *top*, *middle*', | ||
|
@@ -357,6 +390,7 @@ module.exports = { | |
valType: 'number', | ||
dflt: 0, | ||
role: 'style', | ||
editType: 'calcIfAutorange', | ||
description: [ | ||
'Shifts the position of the whole annotation and arrow up', | ||
'(positive) or down (negative) by this many pixels.' | ||
|
@@ -367,6 +401,7 @@ module.exports = { | |
values: [false, 'onoff', 'onout'], | ||
dflt: false, | ||
role: 'style', | ||
editType: 'arraydraw', | ||
description: [ | ||
'Makes this annotation respond to clicks on the plot.', | ||
'If you click a data point that exactly matches the `x` and `y`', | ||
|
@@ -385,6 +420,7 @@ module.exports = { | |
xclick: { | ||
valType: 'any', | ||
role: 'info', | ||
editType: 'arraydraw', | ||
description: [ | ||
'Toggle this annotation when clicking a data point whose `x` value', | ||
'is `xclick` rather than the annotation\'s `x` value.' | ||
|
@@ -393,6 +429,7 @@ module.exports = { | |
yclick: { | ||
valType: 'any', | ||
role: 'info', | ||
editType: 'arraydraw', | ||
description: [ | ||
'Toggle this annotation when clicking a data point whose `y` value', | ||
'is `yclick` rather than the annotation\'s `y` value.' | ||
|
@@ -401,6 +438,7 @@ module.exports = { | |
hovertext: { | ||
valType: 'string', | ||
role: 'info', | ||
editType: 'arraydraw', | ||
description: [ | ||
'Sets text to appear when hovering over this annotation.', | ||
'If omitted or blank, no hover label will appear.' | ||
|
@@ -410,6 +448,7 @@ module.exports = { | |
bgcolor: { | ||
valType: 'color', | ||
role: 'style', | ||
editType: 'arraydraw', | ||
description: [ | ||
'Sets the background color of the hover label.', | ||
'By default uses the annotation\'s `bgcolor` made opaque,', | ||
|
@@ -419,23 +458,27 @@ module.exports = { | |
bordercolor: { | ||
valType: 'color', | ||
role: 'style', | ||
editType: 'arraydraw', | ||
description: [ | ||
'Sets the border color of the hover label.', | ||
'By default uses either dark grey or white, for maximum', | ||
'contrast with `hoverlabel.bgcolor`.' | ||
].join(' ') | ||
}, | ||
font: extendFlat({}, fontAttrs, { | ||
font: fontAttrs({ | ||
editType: 'arraydraw', | ||
description: [ | ||
'Sets the hover label text font.', | ||
'By default uses the global hover font and size,', | ||
'with color from `hoverlabel.bordercolor`.' | ||
].join(' ') | ||
}) | ||
}), | ||
editType: 'arraydraw' | ||
}, | ||
captureevents: { | ||
valType: 'boolean', | ||
role: 'info', | ||
editType: 'arraydraw', | ||
description: [ | ||
'Determines whether the annotation text box captures mouse move', | ||
'and click events, or allows those events to pass through to data', | ||
|
@@ -445,11 +488,13 @@ module.exports = { | |
'you must explicitly enable `captureevents`.' | ||
].join(' ') | ||
}, | ||
editType: 'calc', | ||
|
||
_deprecated: { | ||
ref: { | ||
valType: 'string', | ||
role: 'info', | ||
editType: 'calc', | ||
description: [ | ||
'Obsolete. Set `xref` and `yref` separately instead.' | ||
].join(' ') | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why not use the latest version
jsdom@11
?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.
Because
9.5.0
is what we have in streambed, and it looked like it was going to take me more than 5 minutes to figure out the new API 🙈But you're right, not exactly a good reason - I'll try to upgrade it.