Skip to content

Commit 5b06fb0

Browse files
committed
Merge branch 'master' into fix-autoresize
2 parents 1a0c9eb + ee33d86 commit 5b06fb0

File tree

9 files changed

+125
-43
lines changed

9 files changed

+125
-43
lines changed

shelly/plotlyjs/static/plotlyjs/src/axes.js

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,14 @@ axes.layoutAttributes = {
100100
{valType: 'number'},
101101
{valType: 'number'}
102102
],
103-
description: 'Sets the range of this axis.'
103+
description: [
104+
'Sets the range of this axis.',
105+
'If the axis `type` is *log*, then you must take the log of your desired range',
106+
'(e.g. to set the range from 1 to 100, set the range from 0 to 2).',
107+
'If the axis `type` is *date*, then you must convert the date to unix time in milliseconds',
108+
'(the number of milliseconds since January 1st, 1970). For example, to set the date range from',
109+
'January 1st 1970 to November 4th, 2013, set the range from 0 to 1380844800000.0'
110+
].join(' ')
104111
},
105112
fixedrange: {
106113
valType: 'boolean',
@@ -143,14 +150,31 @@ axes.layoutAttributes = {
143150
role: 'style',
144151
description: [
145152
'Sets the placement of the first tick on this axis.',
146-
'Use with `dtick`.'
153+
'Use with `dtick`.',
154+
'If the axis `type` is *log*, then you must take the log of your starting tick',
155+
'(e.g. to set the starting tick to 100, set the `tick0` to 2).',
156+
'If the axis `type` is *date*, then you must convert the date to unix time in milliseconds',
157+
'(the number of milliseconds since January 1st, 1970).',
158+
'For example, to set the starting tick to',
159+
'November 4th, 2013, set the range to 1380844800000.0.'
147160
].join(' ')
148161
},
149162
dtick: {
150163
valType: 'any',
151164
dflt: 1,
152165
role: 'style',
153-
description: 'Sets the step in-between ticks on this axis'
166+
description: [
167+
'Sets the step in-between ticks on this axis',
168+
'Use with `tick0`.',
169+
'If the axis `type` is *log*, then ticks are set every 10^(n*dtick) where n',
170+
'is the tick number. For example,',
171+
'to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1.',
172+
'To set tick marks at 1, 100, 10000, ... set dtick to 2.',
173+
'To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433.',
174+
'If the axis `type` is *date*, then you must convert the time to milliseconds.',
175+
'For example, to set the interval between ticks to one day,',
176+
'set `dtick` to 86400000.0.'
177+
].join(' ')
154178
},
155179
tickvals: {
156180
valType: 'data_array',

shelly/plotlyjs/static/plotlyjs/src/colorbar.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ colorbar.attributes = {
542542
description: [
543543
'Determines whether this color bar\'s thickness',
544544
'(i.e. the measure in the constant color direction)',
545-
'is set in units of plot *fraction* or in *pixels.',
545+
'is set in units of plot *fraction* or in *pixels*.',
546546
'Use `thickness` to set the value.'
547547
].join(' ')
548548
},
@@ -583,6 +583,8 @@ colorbar.attributes = {
583583
x: {
584584
valType: 'number',
585585
dflt: 1.02,
586+
min: -2,
587+
max: 3,
586588
role: 'style',
587589
description: [
588590
'Sets the x position of the color bar (in plot fraction).'
@@ -594,7 +596,7 @@ colorbar.attributes = {
594596
dflt: 'left',
595597
role: 'style',
596598
description: [
597-
'Sets this color bar\'s horizontal position anchor',
599+
'Sets this color bar\'s horizontal position anchor.',
598600
'This anchor binds the `x` position to the *left*, *center*',
599601
'or *right* of the color bar.'
600602
].join(' ')
@@ -610,6 +612,8 @@ colorbar.attributes = {
610612
valType: 'number',
611613
role: 'style',
612614
dflt: 0.5,
615+
min: -2,
616+
max: 3,
613617
description: [
614618
'Sets the y position of the color bar (in plot fraction).'
615619
].join(' ')

shelly/plotlyjs/static/plotlyjs/src/graph_obj.js

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,7 +1640,19 @@ plots.fontAttrs = {
16401640
valType: 'string',
16411641
role: 'style',
16421642
noBlank: true,
1643-
strict: true
1643+
strict: true,
1644+
description: [
1645+
'HTML font family - the typeface that will be applied by the web browser.',
1646+
'The web browser will only be able to apply a font if it is available on the system',
1647+
'which it operates. Provide multiple font families, separated by commas, to indicate',
1648+
'the preference in which to apply fonts if they aren\'t available on the system.',
1649+
'The plotly service (at https://plot.ly or on-premise) generates images on a server,',
1650+
'where only a select number of',
1651+
'fonts are installed and supported.',
1652+
'These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*,',
1653+
'*Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*,',
1654+
'*PT Sans Narrow*, *Raleway*, *Times New Roman*.'
1655+
].join(' ')
16441656
},
16451657
size: {
16461658
valType: 'number',
@@ -1653,6 +1665,9 @@ plots.fontAttrs = {
16531665
}
16541666
};
16551667

1668+
// TODO make this a plot attribute?
1669+
plots.fontWeight = 'normal';
1670+
16561671
var extendFlat = Plotly.Lib.extendFlat;
16571672

16581673
plots.layoutAttributes = {
@@ -1790,7 +1805,7 @@ plots.layoutAttributes = {
17901805
'Determines whether or not a text link citing the data source is',
17911806
'placed at the bottom-right cored of the figure.',
17921807
'Has only an effect only on graphs that have been generated via',
1793-
'forked graphs from the plotly cloud.'
1808+
'forked graphs from the plotly service (at https://plot.ly or on-premise).'
17941809
].join(' ')
17951810
},
17961811
smith: {
@@ -1908,6 +1923,13 @@ plots.purge = function(gd) {
19081923
// note: we DO NOT remove _context because it doesn't change when we insert
19091924
// a new plot, and may have been set outside of our scope.
19101925

1926+
// clean up the gl and geo containers
1927+
// TODO unify subplot creation/update with d3.selection.order
1928+
// and/or subplot ids
1929+
var fullLayout = gd._fullLayout || {};
1930+
if(fullLayout._glcontainer !== undefined) fullLayout._glcontainer.remove();
1931+
if(fullLayout._geocontainer !== undefined) fullLayout._geocontainer.remove();
1932+
19111933
// data and layout
19121934
delete gd.data;
19131935
delete gd.layout;
@@ -1919,6 +1941,7 @@ plots.purge = function(gd) {
19191941

19201942
delete gd.fid;
19211943

1944+
19221945
delete gd.undoqueue; // action queue
19231946
delete gd.undonum;
19241947
delete gd.autoplay; // are we doing an action that doesn't go in undo queue?
@@ -2926,9 +2949,14 @@ Plotly.restyle = function restyle(gd, astr, val, traces) {
29262949
Plotly.Lib.swapAttrs(cont, ['?', '?src'], 'values', valuesTo);
29272950

29282951
if(oldVal === 'pie') {
2952+
Plotly.Lib.nestedProperty(cont, 'marker.color')
2953+
.set(Plotly.Lib.nestedProperty(cont, 'marker.colors').get());
2954+
29292955
// super kludgy - but if all pies are gone we won't remove them otherwise
29302956
fullLayout._pielayer.selectAll('g.trace').remove();
29312957
} else if(plots.traceIs(cont, 'cartesian')) {
2958+
Plotly.Lib.nestedProperty(cont, 'marker.colors')
2959+
.set(Plotly.Lib.nestedProperty(cont, 'marker.color').get());
29322960
//look for axes that are no longer in use and delete them
29332961
flagAxForDelete[cont.xaxis || 'x'] = true;
29342962
flagAxForDelete[cont.yaxis || 'y'] = true;
@@ -4336,7 +4364,8 @@ plots.titles = function(gd, title) {
43364364
'font-family': font,
43374365
'font-size': d3.round(fontSize,2)+'px',
43384366
fill: Plotly.Color.rgb(fontColor),
4339-
opacity: opacity*Plotly.Color.opacity(fontColor)
4367+
opacity: opacity*Plotly.Color.opacity(fontColor),
4368+
'font-weight': plots.fontWeight
43404369
})
43414370
.attr(options)
43424371
.call(Plotly.util.convertToTspans)

shelly/plotlyjs/static/plotlyjs/src/legend.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ legend.layoutAttributes = {
7373
dflt: 'left',
7474
role: 'info',
7575
description: [
76-
'Sets the legend\'s horizontal position anchor',
76+
'Sets the legend\'s horizontal position anchor.',
7777
'This anchor binds the `x` position to the *left*, *center*',
7878
'or *right* of the legend.'
7979
].join(' ')

shelly/plotlyjs/static/plotlyjs/src/plotly.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,8 @@ exports.Queue = require('./queue');
6666

6767
// exports d3 used in the bundle
6868
exports.d3 = require('d3');
69+
70+
// custom styling injected via envify/uglifyify
71+
if(process.env.PLOTLY_CUSTOM_STYLE === "open-office-2015") {
72+
require('./styles/open_office_2015')();
73+
}

shelly/plotlyjs/static/plotlyjs/src/scatter.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ var scatter = module.exports = {};
1111
Plotly.Plots.register(scatter, 'scatter',
1212
['cartesian', 'symbols', 'markerColorscale', 'errorBarsOK', 'showLegend'], {
1313
description: [
14-
'The data visualized as scatter point or lines is set in `x` and `y`',
14+
'The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts.',
15+
'The data visualized as scatter point or lines is set in `x` and `y`.',
1516
'Text (appearing either on the chart or on hover only) is via `text`.',
1617
'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',
1718
'to a numerical arrays.'
@@ -93,7 +94,9 @@ scatter.attributes = {
9394
'Determines the drawing mode for this scatter trace.',
9495
'If the provided `mode` includes *text* then the `text` elements',
9596
'appear at the coordinates. Otherwise, the `text` elements',
96-
'appear on hover.'
97+
'appear on hover.',
98+
'If there are less than ' + scatter.PTS_LINESONLY + ' points,',
99+
'then the default is *lines+markers*. Otherwise, *lines*.'
97100
].join(' ')
98101
},
99102
line: {
@@ -141,7 +144,10 @@ scatter.attributes = {
141144
values: ['solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'],
142145
dflt: 'solid',
143146
role: 'style',
144-
description: 'Sets the style of the lines.'
147+
description: [
148+
'Sets the style of the lines. Set to a dash string type',
149+
'or a dash length in px.'
150+
].join(' ')
145151
}
146152
},
147153
connectgaps: {
@@ -329,7 +335,7 @@ scatter.attributes = {
329335
valType: 'colorscale',
330336
role: 'style',
331337
description: [
332-
'Has only an effect if `marker.color.line` is set to a numerical array.',
338+
'Has only an effect if `marker.line.color` is set to a numerical array.',
333339
'Sets the colorscale.'
334340
].join(' ')
335341
},
@@ -338,7 +344,7 @@ scatter.attributes = {
338344
dflt: true,
339345
role: 'style',
340346
description: [
341-
'Has only an effect if `marker.color.line` is set to a numerical array.',
347+
'Has only an effect if `marker.line.color` is set to a numerical array.',
342348
'Determines the whether or not the color domain is computed',
343349
'with respect to the input data.'
344350
].join(' ')
@@ -348,7 +354,7 @@ scatter.attributes = {
348354
dflt: null,
349355
role: 'info',
350356
description: [
351-
'Has only an effect if `marker.color.line` is set to a numerical array.',
357+
'Has only an effect if `marker.line.color` is set to a numerical array.',
352358
'Sets the upper bound of the color domain.'
353359
].join(' ')
354360
},
@@ -357,7 +363,7 @@ scatter.attributes = {
357363
dflt: null,
358364
role: 'info',
359365
description: [
360-
'Has only an effect if `marker.color.line` is set to a numerical array.',
366+
'Has only an effect if `marker.line.color` is set to a numerical array.',
361367
'Sets the lower bound of the color domain.'
362368
].join(' ')
363369
},
@@ -366,7 +372,7 @@ scatter.attributes = {
366372
dflt: true,
367373
role: 'style',
368374
description: [
369-
'Has only an effect if `marker.color.line` is set to a numerical array.',
375+
'Has only an effect if `marker.line.color` is set to a numerical array.',
370376
'Determines whether or not the colorscale is picked using',
371377
'the sign of values inside `marker.line.color`.'
372378
].join(' ')
@@ -376,7 +382,7 @@ scatter.attributes = {
376382
dflt: false,
377383
role: 'style',
378384
description: [
379-
'Has only an effect if `marker.color.line` is set to a numerical array.',
385+
'Has only an effect if `marker.line.color` is set to a numerical array.',
380386
'Reverses the colorscale.'
381387
].join(' ')
382388
}

shelly/plotlyjs/static/plotlyjs/src/shapes.js

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,6 @@ var extendFlat = Plotly.Lib.extendFlat,
1010

1111
shapes.layoutAttributes = {
1212
_isLinkedToArray: true,
13-
opacity: {
14-
valType: 'number',
15-
min: 0,
16-
max: 1,
17-
dflt: 1,
18-
role: 'info',
19-
description: 'Sets the opacity of the shape.'
20-
},
21-
line: {
22-
color: scatterLineAttrs.color,
23-
width: scatterLineAttrs.width,
24-
dash: scatterLineAttrs.dash,
25-
role: 'info'
26-
},
27-
fillcolor: {
28-
valType: 'color',
29-
dflt: 'rgba(0,0,0,0)',
30-
role: 'info',
31-
description: [
32-
'Sets the color filling the shape\'s interior.'
33-
].join(' ')
34-
},
3513
type: {
3614
valType: 'enumerated',
3715
values: ['circle', 'rect', 'path', 'line'],
@@ -132,6 +110,29 @@ shapes.layoutAttributes = {
132110
'Therefore we\'ll use underscore for this purpose:',
133111
'2015-02-21_13:45:56.789'
134112
].join(' ')
113+
},
114+
115+
opacity: {
116+
valType: 'number',
117+
min: 0,
118+
max: 1,
119+
dflt: 1,
120+
role: 'info',
121+
description: 'Sets the opacity of the shape.'
122+
},
123+
line: {
124+
color: scatterLineAttrs.color,
125+
width: scatterLineAttrs.width,
126+
dash: scatterLineAttrs.dash,
127+
role: 'info'
128+
},
129+
fillcolor: {
130+
valType: 'color',
131+
dflt: 'rgba(0,0,0,0)',
132+
role: 'info',
133+
description: [
134+
'Sets the color filling the shape\'s interior.'
135+
].join(' ')
135136
}
136137
};
137138

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
3+
var Plotly = require('../plotly');
4+
5+
module.exports = function updateStyle() {
6+
Plotly.Color.defaults = [
7+
'#CC0000', '#5E6A71', '#BBDDE7', '#55aab2', '#a4b0b7'
8+
];
9+
10+
Plotly.Plots.layoutAttributes.font.family.dflt = '"Overpass", verdana, arial, sans-serif';
11+
12+
Plotly.Plots.fontWeight = 900;
13+
};

test-dashboard/toolpanel-dashboard/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
<!-- ToolPanel JS dependencies Bundle -->
1818
<script type="text/javascript" src="./../../shelly/toolpanel/static/toolpanel/dist/toolpanel-dependencies-bundle.js"></script>
1919

20-
<!-- ToolPanel Standalone JS Bundle -->
21-
<script type="text/javascript" src="./../../shelly/toolpanel/static/toolpanel/dist/toolpanel-standalone-bundle.js"></script>
22-
2320
<!-- PlotlyJS Bundle -->
2421
<script type="text/javascript" src="./../../shelly/plotlyjs/static/plotlyjs/build/plotlyjs-bundle.js"></script>
2522

23+
<!-- ToolPanel Standalone JS Bundle -->
24+
<script type="text/javascript" src="./../../shelly/toolpanel/static/toolpanel/dist/toolpanel-standalone-bundle.js"></script>
25+
2626
<!-- UI Stuff -->
2727
<script type="text/javascript" src="ui.js"></script>
2828

0 commit comments

Comments
 (0)