MCPcopy Create free account
hub / github.com/microsoft/SandDance / cloneAxis

Function cloneAxis

docs/app/js/sanddance-app.js:10064–10077  ·  view source on GitHub ↗
(axes, axisColor, axisTextColor)

Source from the content-addressed store, hash-verified

10062parcelHelpers.export(exports, "recolorAxes", ()=>recolorAxes);
10063var _vegaDeckGl = require("@msrvida/vega-deck.gl");
10064function cloneAxis(axes, axisColor, axisTextColor) {
10065 return axes.map((axis)=>{
10066 const newAxis = _vegaDeckGl.util.deepMerge(axis);
10067 if (newAxis.domain) newAxis.domain.color = axisColor;
10068 if (newAxis.title) newAxis.title.color = axisTextColor;
10069 newAxis.ticks.forEach((t)=>{
10070 t.color = axisColor;
10071 });
10072 newAxis.tickText.forEach((t)=>{
10073 t.color = axisTextColor;
10074 });
10075 return newAxis;
10076 });
10077}
10078function cloneTextData(textData, color) {
10079 return textData.map((t)=>{
10080 return Object.assign(Object.assign({}, t), {

Callers 1

recolorAxesFunction · 0.70

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected