You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Plotly.d3.json('https://raw.githubusercontent.com/plotly/datasets/master/custom_heatmap_colorscale.json',function(figure){vardata=[{z: figure.z,colorscale: 'Blackbody',type: 'heatmap',colorbar: {tickvals: [25,50,75]// Works fine// tickvals: new Float32Array([25, 50, 75]) // Gets ignored}}];varlayout={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?
The text was updated successfully, but these errors were encountered:
Yeah, that makes sense. I can add some special handling for tickvals and other uncorrelated data_arrays as we find them. An eventual schema change like you discuss in #1894 would be nice in the long run.
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
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 witharrayOk
oftrue
). Is the goal for all such properties in Plotly.js to accept typed arrays?The text was updated successfully, but these errors were encountered: