MCPcopy Create free account
hub / github.com/plotly/plotly.js / validateCategoryProperties

Function validateCategoryProperties

src/traces/parcats/calc.js:467–483  ·  view source on GitHub ↗

* Update category properties based on the unique values found for this dimension * @param {Object} dim * @param {UniqueInfo} uniqueInfoDim

(dim, uniqueInfoDim)

Source from the content-addressed store, hash-verified

465 * @param {UniqueInfo} uniqueInfoDim
466 */
467function validateCategoryProperties(dim, uniqueInfoDim) {
468 // Update categoryarray
469 dim._categoryarray = uniqueInfoDim.uniqueValues;
470
471 // Handle ticktext
472 if(dim.ticktext === null || dim.ticktext === undefined) {
473 dim._ticktext = [];
474 } else {
475 // Shallow copy to avoid modifying input array
476 dim._ticktext = dim.ticktext.slice();
477 }
478
479 // Extend ticktext with elements from uniqueInfoDim.uniqueValues
480 for(var i = dim._ticktext.length; i < uniqueInfoDim.uniqueValues.length; i++) {
481 dim._ticktext.push(uniqueInfoDim.uniqueValues[i]);
482 }
483}
484
485/**
486 * Determine whether an array contains a permutation of the integers from 0 to the array's length - 1

Callers 1

calc.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…