@cardenelabs/cdl 0.40.3 → 0.40.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cardenelabs/cdl",
3
- "version": "0.40.3",
3
+ "version": "0.40.4",
4
4
  "description": "CDL (Chainome Diagram Language). Mermaid-like declarative DSL that compiles to animated SVG diagrams. Built for blockchain / Solidity flows, generic enough for sequence / flow / state / ER / topology diagrams.",
5
5
  "license": "MIT",
6
6
  "author": "cardene777",
@@ -1,4 +1,4 @@
1
- import { clamp01, easeOutQuint } from "./easing";
1
+ import { clamp01, easeOut } from "./easing";
2
2
  import type {
3
3
  EasingFn,
4
4
  PhaseDescriptor,
@@ -30,7 +30,7 @@ import type {
30
30
  export type TimelineOptions = {
31
31
  /** 自動進行時の Phase 間 wait (ms)、 デフォルト Phase の durationMs に従う */
32
32
  autoAdvanceMs?: number;
33
- /** Phase 内補間の easing、 デフォルト easeOutQuint */
33
+ /** Phase 内補間の easing、 デフォルト easeOut */
34
34
  easing?: EasingFn;
35
35
  /** loop 再生するか (settled 後に最初に戻る)、 デフォルト false */
36
36
  loop?: boolean;
@@ -86,7 +86,17 @@ export class Timeline {
86
86
  throw new Error("Timeline requires at least one phase");
87
87
  }
88
88
  this.phases = phases;
89
- this.easing = options.easing ?? easeOutQuint;
89
+ /**
90
+ * 既定の曲線 (cdl#736)。
91
+ *
92
+ * **`easeOutQuint` は動きが前半に寄りすぎる**。 実測で、段の長さ 1.2 秒の tween は
93
+ * 9 割が最初の 0.449 秒で終わり、残りの 0.75 秒はほとんど止まって見えた
94
+ * (半分に達するのが段の 13.1% の時点)。 段を長くしても形は変わらず、止まって
95
+ * 見える時間だけが伸びる。
96
+ *
97
+ * `easeOut` は半分に達するのが 34.2% の時点で、段の終わりまで動き続ける。
98
+ */
99
+ this.easing = options.easing ?? easeOut;
90
100
  this.loop = options.loop ?? false;
91
101
  this.autoAdvanceMsOverride = options.autoAdvanceMs;
92
102
  this.phaseHoldMs = options.phaseHoldMs ?? 0;
@@ -40,7 +40,7 @@ export type TimelineState = {
40
40
  /**
41
41
  * 曲線を通す前の進行度 (0..1、 cdl#711)。 経過時間そのものの割合。
42
42
  *
43
- * `phaseProgress` は既定で `easeOutQuint` を通るため前半に動きが寄る。
43
+ * `phaseProgress` は既定で `easeOut` を通るため素の進みより先に出る。
44
44
  * **値が落ち着く動きには合うが、 線を引く動きには合わない** =
45
45
  * `1.2s` の段で半分に達するのが 158 ms になり、 折れ線の 5 点のうち 4 点が
46
46
  * 292 ms の間に出てしまう (実測)。
package/src/render.tsx CHANGED
@@ -136,8 +136,10 @@ export function CdlDiagramView({ diagram, laid: laidProp, hideHeader = false, hi
136
136
  /**
137
137
  * 描く動きが読む進み (cdl#711)。 曲線を通さない = 経過時間そのものの割合。
138
138
  *
139
- * 線を引く動きに `easeOutQuint` を当てると前半に寄り、 折れ線の 5 点のうち 4 点が
140
- * 292 ms の間に出る。 ペンの速さは一定であるほど「1 つずつ現れる」 が読める。
139
+ * 線を引く動きに段の曲線を当てると前半に寄る。 当時の既定 (`easeOutQuint`) では
140
+ * 折れ線の 5 点のうち 4 点が 292 ms の間に出た。 曲線をゆるめた後 (`cdl#736` の
141
+ * `easeOut`) も寄る向きは同じなので、 描く動きは曲線を通さないままにする。
142
+ * ペンの速さは一定であるほど「1 つずつ現れる」 が読める。
141
143
  */
142
144
  const drawProgress = reduced ? 1 : state.phaseLinearProgress;
143
145