Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
Cartesian dropline support#1461
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
d9fab155d39b53be4753317d815c162068e762b54ad680bd42433d4c75da2fe795348855b17b2b9f6ab17fe436334a15628c7ac766e243dec036bf708371c269dc78137b77fe710d2d6e509fa775121d2bd115673a9aa58052417ba3a0a4ff7b467e7aa43595925049File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /** | ||
| * Copyright 2012-2017, 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'; | ||
| exports.dash = { | ||
| valType: 'string', | ||
| // string type usually doesn't take values... this one should really be | ||
| // a special type or at least a special coercion function, from the GUI | ||
| // you only get these values but elsewhere the user can supply a list of | ||
| // dash lengths in px, and it will be honored | ||
| values: ['solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'], | ||
| dflt: 'solid', | ||
| role: 'style', | ||
| description: [ | ||
| 'Sets the dash style of lines. Set to a dash type string', | ||
| '(*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*)', | ||
| 'or a dash length list in px (eg *5px,10px,2px,2px*).' | ||
| ].join(' ') | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -149,7 +149,7 @@ proto.createButton = function(config) { | ||
| button.setAttribute('data-toggle', config.toggle || false); | ||
| if(config.toggle) d3.select(button).classed('active', true); | ||
| button.appendChild(this.createIcon(config.icon || Icons.question)); | ||
| button.appendChild(this.createIcon(config.icon || Icons.question, config.name)); | ||
| button.setAttribute('data-gravity', config.gravity || 'n'); | ||
| return button; | ||
| @@ -162,7 +162,7 @@ proto.createButton = function(config) { | ||
| * @Param {string} thisIcon.path | ||
| * @Return {HTMLelement} | ||
| */ | ||
| proto.createIcon = function(thisIcon) { | ||
| proto.createIcon = function(thisIcon, name) { | ||
| var iconHeight = thisIcon.ascent - thisIcon.descent, | ||
| svgNS = 'http://www.w3.org/2000/svg', | ||
| icon = document.createElementNS(svgNS, 'svg'), | ||
| @@ -172,8 +172,12 @@ proto.createIcon = function(thisIcon) { | ||
| icon.setAttribute('width', (thisIcon.width / iconHeight) + 'em'); | ||
| icon.setAttribute('viewBox', [0, 0, thisIcon.width, iconHeight].join(' ')); | ||
| var transform = name === 'toggleSpikelines' ? | ||
Contributor 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. A little hacky here. Ideally, the icon should have been exported 50% bigger. I opted for this hacky fix because implementing some icon
| ||
| 'matrix(1.5 0 0 -1.5 0 ' + thisIcon.ascent + ')' : | ||
| 'matrix(1 0 0 -1 0 ' + thisIcon.ascent + ')'; | ||
| path.setAttribute('d', thisIcon.path); | ||
| path.setAttribute('transform', 'matrix(1 0 0 -1 0 ' + thisIcon.ascent + ')'); | ||
| path.setAttribute('transform', transform); | ||
| icon.appendChild(path); | ||
| return icon; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -153,6 +153,9 @@ Plotly.plot = function(gd, data, layout, config) { | ||
| makePlotFramework(gd); | ||
| } | ||
| // save initial show spikes once per graph | ||
| if(graphWasEmpty) Plotly.Axes.saveShowSpikeInitial(gd); | ||
| // prepare the data and find the autorange | ||
| // generate calcdata, if we need to | ||
| @@ -2121,14 +2124,16 @@ function _relayout(gd, aobj) { | ||
| flags.doticks = flags.dolayoutstyle = true; | ||
| } | ||
| /* | ||
| * hovermodeand dragmode don't need any redrawing, since they just | ||
| * affect reaction to user input, everything else, assume full replot. | ||
| * hovermode, dragmode, and spikes don't need any redrawing, since they just | ||
| * affect reaction to user input. Everything else, assume full replot. | ||
| * height, width, autosize get dealt with below. Except for the case of | ||
| * of subplots - scenes - which require scene.updateFx to be called. | ||
| */ | ||
| else if(['hovermode', 'dragmode'].indexOf(ai) !== -1) flags.domodebar = true; | ||
| else if(['hovermode', 'dragmode', 'height', | ||
| 'width', 'autosize'].indexOf(ai) === -1) { | ||
| else if(['hovermode', 'dragmode'].indexOf(ai) !== -1 || | ||
| ai.indexOf('spike') !== -1) { | ||
| flags.domodebar = true; | ||
Contributor 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. 🐎 | ||
| } | ||
| else if(['height', 'width', 'autosize'].indexOf(ai) === -1) { | ||
| flags.doplot = true; | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.

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.
Personally, I think I'd prefer placing this new icon first from the right. Thoughts?
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.
My reasoning was to put it beside
hovermode: closestbecause of how spikeline functionality is tied to that mode. (Needed for any spikelines, and using the toggle will force you into that mode)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.
Good point. I'm ok leaving it there.