@beeson-group/tycho 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/AUTHORS +8 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +14 -0
  4. package/README.md +38 -0
  5. package/THIRD_PARTY_NOTICES.md +68 -0
  6. package/dist/tycho.esm.js +1517 -760
  7. package/dist/tycho.js +1517 -760
  8. package/dist/types/container.d.ts +64 -0
  9. package/dist/types/errors.d.ts +9 -0
  10. package/dist/types/evaluate/clock.d.ts +36 -0
  11. package/dist/types/evaluate/frames.d.ts +63 -0
  12. package/dist/types/evaluate/index.d.ts +21 -0
  13. package/dist/types/evaluate/layers.d.ts +108 -0
  14. package/dist/types/evaluate/resolve.d.ts +50 -0
  15. package/dist/types/evaluate/sets.d.ts +50 -0
  16. package/dist/types/evaluate/timeline.d.ts +60 -0
  17. package/dist/types/evaluate/types.d.ts +87 -0
  18. package/dist/types/index.d.ts +22 -0
  19. package/dist/types/runtime/colormaps.d.ts +10 -0
  20. package/dist/types/runtime/colors.d.ts +121 -0
  21. package/dist/types/runtime/element.d.ts +290 -0
  22. package/dist/types/runtime/export.d.ts +129 -0
  23. package/dist/types/runtime/geometry.d.ts +217 -0
  24. package/dist/types/runtime/icons.d.ts +66 -0
  25. package/dist/types/runtime/layout.d.ts +34 -0
  26. package/dist/types/runtime/outline.d.ts +29 -0
  27. package/dist/types/runtime/overlay.d.ts +33 -0
  28. package/dist/types/runtime/paint.d.ts +110 -0
  29. package/dist/types/runtime/raster.d.ts +33 -0
  30. package/dist/types/runtime/readouts.d.ts +136 -0
  31. package/dist/types/runtime/renderer.d.ts +551 -0
  32. package/dist/types/runtime/state.d.ts +104 -0
  33. package/dist/types/runtime/tiles.d.ts +33 -0
  34. package/dist/types/scene.d.ts +51 -0
  35. package/dist/types/scene.gen.d.ts +2033 -0
  36. package/dist/types/validate.d.ts +9 -0
  37. package/package.json +63 -35
  38. package/src/colormaps.ts +0 -42
  39. package/src/container.ts +0 -126
  40. package/src/element.ts +0 -1034
  41. package/src/frames.ts +0 -204
  42. package/src/index.ts +0 -14
  43. package/src/layout.ts +0 -82
  44. package/src/viewer.ts +0 -864
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Where the panels of a layout tree sit on a panel area. The placement is a pure function of the tree
3
+ * and the panel area rectangle, and both the page and the renderer use it, so that a frame does not
4
+ * depend on how the browser lays out the page.
5
+ */
6
+ import type { Layout } from '../scene.js';
7
+ export interface Rect {
8
+ x: number;
9
+ y: number;
10
+ w: number;
11
+ h: number;
12
+ }
13
+ /** One split's gutter: its rectangle, the rectangle of the whole split, and the path to the split. */
14
+ export interface Gutter {
15
+ path: string;
16
+ dir: 'row' | 'col';
17
+ rect: Rect;
18
+ outer: Rect;
19
+ }
20
+ export interface Tiles {
21
+ panels: Map<string, Rect>;
22
+ gutters: Gutter[];
23
+ }
24
+ /**
25
+ * Tiles `rect` by the layout. A split gives `ratio` of its extent less the gutter to `a`, in
26
+ * whole pixels, and the rest to `b`. A gutter's path is the string of letters a and b
27
+ * that leads from the root to the split.
28
+ */
29
+ export declare function tile(layout: Layout, rect: Rect, gutter: number): Tiles;
30
+ /** The layout with the ratio of the split at `path` replaced. */
31
+ export declare function withRatio(layout: Layout, path: string, ratio: number): Layout;
32
+ /** The ratio of a split for a pointer at (x, y), in the split's rectangle less its gutter, kept in [0.1, 0.9]. */
33
+ export declare function ratioAt(g: Gutter, x: number, y: number, gutter: number): number;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Scene types. Every structural type comes from scene.gen.ts, which is generated from
3
+ * spec/scene.schema.json, and the types therefore cannot drift apart from the schema. The aliases below
4
+ * only name parts that the generator, web/scripts/gen-types.mjs, leaves anonymous.
5
+ */
6
+ import type { Input, Layer, State, TrajectorySet } from './scene.gen.js';
7
+ export type * from './scene.gen.js';
8
+ export type ChannelDef = NonNullable<NonNullable<TrajectorySet['channels']>[string]>;
9
+ export type ParameterDef = NonNullable<NonNullable<TrajectorySet['parameters']>[string]>;
10
+ export type TrajectoriesLayer = Extract<Layer, {
11
+ kind: 'trajectories';
12
+ }>;
13
+ export type ArrowLayer = Extract<Layer, {
14
+ kind: 'arrow';
15
+ }>;
16
+ export type InsetBoxLayer = Extract<Layer, {
17
+ kind: 'inset_box';
18
+ }>;
19
+ export type BodyLayer = Extract<Layer, {
20
+ kind: 'body';
21
+ }>;
22
+ export type MarkLayer = Extract<Layer, {
23
+ kind: 'axes' | 'grid';
24
+ }>;
25
+ export type LabelLayer = Extract<Layer, {
26
+ kind: 'label';
27
+ }>;
28
+ export type PointsLayer = Extract<Layer, {
29
+ kind: 'points';
30
+ }>;
31
+ export type ParameterInput = Extract<Input, {
32
+ kind: 'parameter';
33
+ }>;
34
+ export type Choice = Extract<Input, {
35
+ kind: 'choice';
36
+ }>;
37
+ export type Toggle = Extract<Input, {
38
+ kind: 'toggle';
39
+ }>;
40
+ export type ShownPanel = NonNullable<State['panels'][string]>;
41
+ export type InputValue = number | string | boolean;
42
+ /** The scene format version this reader implements. */
43
+ export declare const SCENE_MAJOR = 0;
44
+ export declare const SCENE_MINOR = 5;
45
+ /** Features from `requires` that this reader implements, i.e. the features of section 4 that version 0.5 of the format includes. */
46
+ export declare const SUPPORTED_FEATURES: ReadonlySet<string>;
47
+ export declare const TOP_LEVEL_KEYS: ReadonlySet<string>;
48
+ export declare const ID_PATTERN: RegExp;
49
+ export declare const INDEX_CHANNEL = "@index";
50
+ /** The built-in parameter whose value is the number of the member in its set. */
51
+ export declare const INDEX_PARAMETER = "@index";