Skip to main content
Module

x/fresh_charts/deps.ts>ChartJs.Defaults

A server-side-rendered charting library for Fresh
Go to Latest
import { type ChartJs } from "https://deno.land/x/fresh_charts@0.2.0/deps.ts";
const { Defaults } = ChartJs;

Methods

set(values: AnyObject): AnyObject
set(scope: string, values: AnyObject): AnyObject
get(scope: string): AnyObject
describe(scope: string, values: AnyObject): AnyObject
override(scope: string, values: AnyObject): AnyObject
route(
scope: string,
name: string,
targetScope: string,
targetName: string,
): void

Routes the named defaults to fallback to another scope/name. This routing is useful when those target values, like defaults.color, are changed runtime. If the values would be copied, the runtime change would not take effect. By routing, the fallback is evaluated at each access, so its always up to date.

Example:

defaults.route('elements.arc', 'backgroundColor', '', 'color')

  • reads the backgroundColor from defaults.color when undefined locally