MCPcopy
hub / github.com/audreyt/ethercalc / applyPaletteConstants

Function applyPaletteConstants

packages/client/src/graph.ts:369–418  ·  view source on GitHub ↗
(SocialCalc: SocialCalcGlobal)

Source from the content-addressed store, hash-verified

367}
368
369function applyPaletteConstants(SocialCalc: SocialCalcGlobal): void {
370 const scc = SocialCalc.Constants;
371 scc['s_loc_horizontal_bar'] = 'Horizontal Bar';
372 scc['s_loc_vertical_bar'] = 'Vertical Bar';
373 scc['s_loc_pie_chart'] = 'Pie Chart';
374 scc['s_loc_line_chart'] = 'Line Chart';
375 scc['s_loc_scatter_chart'] = 'Scatter Chart';
376 scc['s_loc_hide_help'] = 'Hide Help';
377 const selectedbg = '404040';
378 const unselectedbg = '808080';
379 let cursorbg = 'A6A6A6';
380 let fg = 'FFF';
381 if (SocialCalc.requestParams?.['app'] !== undefined) {
382 cursorbg = 'FFF';
383 fg = '000';
384 }
385 scc['SCToolbarbackground'] = 'background-color:#' + selectedbg + ';';
386 scc['SCTabbackground'] = 'background-color:#' + unselectedbg + ';';
387 scc['SCTabselectedCSS'] =
388 'font-size:small;padding:6px 30px 6px 8px;color:#FFF;background-color:#' +
389 selectedbg +
390 ';cursor:default;border-right:1px solid #CCC;';
391 scc['SCTabplainCSS'] =
392 'font-size:small;padding:6px 30px 6px 8px;color:#FFF;background-color:#' +
393 unselectedbg +
394 ';cursor:default;border-right:1px solid #CCC;';
395 scc['SCToolbartext'] = 'font-size:x-small;font-weight:bold;color:#FFF;padding-bottom:4px;';
396 scc['ISCButtonBorderNormal'] = '#' + selectedbg;
397 scc['ISCButtonBorderHover'] = '#999';
398 scc['ISCButtonBorderDown'] = '#FFF';
399 scc['ISCButtonDownBackground'] = '#888';
400 scc['defaultImagePrefix'] = 'images/sc_';
401 scc['defaultColnameStyle'] =
402 'overflow:visible;font-size:small;text-align:center;color:#' + fg + ';background-color:#' + unselectedbg;
403 scc['defaultSelectedColnameStyle'] =
404 'overflow:visible;font-size:small;text-align:center;color:#' + fg + ';background-color:#' + selectedbg;
405 scc['defaultRownameStyle'] =
406 'position:relative;overflow:visible;font-size:small;text-align:center;vertical-align:middle;color:#' +
407 fg +
408 ';background-color:#' +
409 unselectedbg +
410 ';direction:rtl;';
411 scc['defaultSelectedRownameStyle'] =
412 'position:relative;overflow:visible;font-size:small;text-align:center;vertical-align:middle;color:#' +
413 fg +
414 ';background-color:#' +
415 selectedbg +
416 ';';
417 scc['defaultHighlightTypeCursorStyle'] = 'color:#' + fg + ';backgroundColor:#' + cursorbg + ';';
418}
419
420// ─── Chart drawing functions ─────────────────────────────────────────────
421// The bodies below port the canvas-math from the legacy file verbatim.

Callers 1

installGraphFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected