-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
OHLC and Candlestick trace types #1020
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
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
e915a29
relax requirement for re-calc
etpinard cf5da9b
plots: pass user layout to transforms
etpinard 7864fa8
first pass ohlc trace type
etpinard 44f2bec
first pass candlestick trace type
etpinard df24552
add ohlc and candlestick to main plotly.js lib index
etpinard 6cac3fe
[maybe?] add 'finance' partial bundle
etpinard 0f17423
fixup user-defined transform test
etpinard 61c72cc
finance: replace attribute 't' -> 'x'
etpinard a9eb7c5
candlestick: rename 'tickwidth' -> 'whiskerwidth' + make it 1 per trace
etpinard ede8ee2
ohlc: make 'tickwidth' 1 per trace
etpinard f6c33f2
finance: 2nd iteration
etpinard 96e129a
fix groupby when `enabled: false
etpinard e32b60f
findArrayAttributes: include array attribute in fullInput module
etpinard d61afb9
test: first pass finance suite
etpinard dc8aaea
finace: ensure supplyDefaults is idempotent
etpinard 5c94c05
finance: add re-calc attributes to restyle lists
etpinard 1f574f2
finance: ensure that restyling visible works
etpinard 7b19b74
finance: improve dflt colors
etpinard 2b1918c
finance: improve inc / dec 'name' / 'showlegend' logic
etpinard fbb299b
legend: add logic for 'ohlc' and 'candlestick' in legend name edits
etpinard caf390b
doc: add comments about non-trivial logic in ohlc / candlestick
etpinard 672d517
finance: pass trace 'xaxis' & 'yaxis' to generated traces
etpinard ea3c5a1
finance: make sure computed tickWidth is always positive
etpinard a892b26
olhc: add custom hover text
etpinard 7e0a382
finance: ensure that user data isn't mutated in Plots.supplyDefaults
etpinard f6f072f
utils: add filterUnique helper
etpinard 6036045
ohlc: don't force hovermode: 'closest'
etpinard d26a4b4
ohlc: bump tickwidth dflt to 0.1
etpinard 3803005
finance: add common 'line' style container
etpinard facbf3d
test: add finance mocks
etpinard b98835c
ohlc: bump tickwidth dflt to 0.3
etpinard c9de6c8
test: add finance trace module bundle test
etpinard 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
finance: improve inc / dec 'name' / 'showlegend' logic
- remove `increasing/decreasing.visible` attribute - add increasing/decreasing 'name' and 'showlegend'
- Loading branch information
commit 2b1918cfe13b01106ff58a2d466379c4b1ee776a
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Copyright 2012-2016, 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'; | ||
|
||
|
||
module.exports = function handleDirectionDefaults(traceIn, traceOut, coerce, direction) { | ||
coerce(direction + '.showlegend'); | ||
|
||
// trace-wide *showlegend* overrides direction *showlegend* | ||
if(traceIn.showlegend === false) { | ||
traceOut[direction].showlegend = false; | ||
} | ||
|
||
var nameDflt = traceOut.name + ' - ' + direction; | ||
|
||
coerce(direction + '.name', nameDflt); | ||
}; |
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.
I probably should have noticed this earlier (sorry!) but
color
andwidth
seem odd for line color and width. It took me a bit to figure out that this wasn't the width of the candle, and that we don't need an attribute for that becauselayout.boxgap
does that... This should probably be mentioned somewhere!Also just like
whiskerwidth
I'd thinkwidth
is a property shared by both directions. Can we call theselinecolor
(indirectionAttrs
) andlinewidth
(inattributes
)? I guess we could argue that for consistency these should go inside aline
container instead... it seems a bit funny to make a one-member container just to keep the names consistent but maybe that will actually be easier and clearer.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.
sounds good.
Agreed. I much prefer
increasing.linecolor
anddecreasing.lincolor