Skip to content

packages/core/src/features/viz/lib/use-symlog-scale.ts

Read as Markdown

This is the source snapshot used to build these API details. View this revision on GitHub.

Back to reference

1 import type { Signal } from "@pibbl/core";
2 import type { ResolvedSymlogScale, ResolvedScale, ScaleId } from "./types.js";
3 import { scaleView } from "./scale-view.js";
4 const views = new WeakMap<Signal<ResolvedScale>, Signal<ResolvedSymlogScale>>();
5 /**
6  * Reads an ancestor symlog scale as a stable shared readonly signal.
7  * @param id - Ancestor scale identity. See {@link ScaleId}.
8  * @returns The reactive mapping. See {@link ResolvedSymlogScale}.
9  */
10 export function useSymlogScale(id: ScaleId): Signal<ResolvedSymlogScale> {
11   return scaleView(views, id, "useSymlogScale", kind => kind === "symlog");
12 }
13 

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.