-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Templates #2761
Merged
Merged
Templates #2761
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
b8950c5
fix devtools timeit sorting
alexcjohnson 355fb09
stop pushing tickmode back to axis in for a particular edge case
alexcjohnson 8ddcfd6
minor simplification in pie defaults
alexcjohnson b5ccfbe
combine annotation defaults files & shape defaults files
alexcjohnson 86e09bb
add visible attribute to lots of container array items:
alexcjohnson 3dee25c
use handleArrayContainerDefaults for various array containers:
alexcjohnson 5cca8d3
templates - big commit implementing most of it, coerce-level integration
bpostlethwaite b3da4e7
:hocho: itemIsNotPlainObject from handleArrayContainerDefaults
alexcjohnson 8525953
add template attributes to array containers
alexcjohnson e306d1c
template-safe axis default color inheritance logic
alexcjohnson 8e2a321
template-safe GUI editing of array objects
alexcjohnson 4346611
template mock
alexcjohnson fb489aa
tickformatstops.visible -> enabled
alexcjohnson bc21cc8
:hocho: done TODO
alexcjohnson 8490804
fix test failures - and simplify handleArrayContainerDefaults even mo…
alexcjohnson c2bcfe3
fix makeTemplate and test it & template interactions
alexcjohnson 890a324
fix Plotly.validate with attributes that end in numbers
alexcjohnson aed44dc
Plotly.validateTemplate
alexcjohnson 6df61e0
loosen template default item interaction tests to pass on CI
alexcjohnson ef4c3cc
TODO -> note re: axis.type _noTemplate
alexcjohnson b1c6f0a
_noTemplating for angularaxis.type
alexcjohnson 818cac9
:cow2: test name typo
alexcjohnson 15931cf
recurse into (template)layout looking for unused containers
alexcjohnson 8598bc9
:hocho: obsolete code
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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright 2012-2018, Plotly, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
/** | ||
* mergeLength: set trace length as the minimum of all dimension data lengths | ||
* and propagates this length into each dimension | ||
* | ||
* @param {object} traceOut: the fullData trace | ||
* @param {Array(object)} dimensions: array of dimension objects | ||
* @param {string} dataAttr: the attribute of each dimension containing the data | ||
* @param {integer} len: an already-existing length from other attributes | ||
*/ | ||
module.exports = function(traceOut, dimensions, dataAttr, len) { | ||
if(!len) len = Infinity; | ||
var i, dimi; | ||
for(i = 0; i < dimensions.length; i++) { | ||
dimi = dimensions[i]; | ||
if(dimi.visible) len = Math.min(len, dimi[dataAttr].length); | ||
} | ||
if(len === Infinity) len = 0; | ||
|
||
traceOut._length = len; | ||
for(i = 0; i < dimensions.length; i++) { | ||
dimi = dimensions[i]; | ||
if(dimi.visible) dimi._length = len; | ||
} | ||
|
||
return len; | ||
}; |
This file contains 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.
Nicely done 🥇