Closed
Description
If I set the colorbar.tickvals
property to an array of numbers, ticks are placed at the locations specified by the array. If I do the same with a typed array, the typed array seems to be ignored.
codepen: https://codepen.io/anon/pen/VXVyQr
Plotly.d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json', function(figure) {
var data = [{
z: figure.z,
colorscale: 'Blackbody',
type: 'heatmap',
colorbar: {
tickvals: [25, 50, 75] // Works fine
// tickvals: new Float32Array([25, 50, 75]) // Gets ignored
}
}
];
var layout = {title: 'Blackbody'};
Plotly.newPlot('myDiv', data, layout);
});
I know this isn't a situation where there would be a performance gain from using a typed array, but I came across this during the plotly.py ipywidget effort (plotly/plotly.py#942) where numpy arrays are converted into typed arrays before being passed to the Plotly.js library (for all properties with valType
of "data_array"
and properties with arrayOk
of true
). Is the goal for all such properties in Plotly.js to accept typed arrays?
Metadata
Metadata
Assignees
Labels
No labels