courthive-components 1.8.1 → 1.10.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.
- package/dist/components/burstChart/burstChart.d.ts +20 -14
- package/dist/components/burstChart/competitiveness.d.ts +43 -0
- package/dist/components/categories/ageCategory/ageCategory.d.ts +4 -0
- package/dist/components/matchUpFormat/matchUpFormat.d.ts +4 -0
- package/dist/components/modal/cmodal.d.ts +4 -0
- package/dist/components/modal/scheduleCellConfigModal.d.ts +4 -0
- package/dist/courthive-components.es.js +1817 -1746
- package/dist/courthive-components.umd.js +23 -22
- package/dist/index.d.ts +3 -1
- package/package.json +7 -7
- /package/dist/{dist-D8bGN7nf.mjs → dist-CwJOJWf0.mjs} +0 -0
- /package/dist/{range-B1T9TbVf.mjs → range-CBX41Ttl.mjs} +0 -0
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* BurstChart D3v7 - Tournament Sunburst Visualization
|
|
3
|
-
*
|
|
4
|
-
* Modern D3v7 implementation with emoji flags and clean TypeScript architecture.
|
|
5
|
-
* Consumes TODS-aligned SunburstDrawData natively.
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - D3v7 partition layout
|
|
9
|
-
* - Emoji flags (no image dependencies)
|
|
10
|
-
* - Interactive hover with winner/opponent display
|
|
11
|
-
* - Tournament title with text wrapping
|
|
12
|
-
* - Color coding by seed/entry type
|
|
13
|
-
* - Three-line hover display (winner, score, opponent)
|
|
14
|
-
*/
|
|
1
|
+
import { CompetitivenessBucket } from '../competitivenessBar/types';
|
|
15
2
|
/** TODS-aligned draw structure for the sunburst */
|
|
16
3
|
export interface SunburstDrawData {
|
|
17
4
|
drawSize: number;
|
|
@@ -28,6 +15,7 @@ export interface SunburstMatchUp {
|
|
|
28
15
|
winningSide?: number;
|
|
29
16
|
drawPositions: number[];
|
|
30
17
|
scoreString?: string;
|
|
18
|
+
competitiveness?: CompetitivenessBucket;
|
|
31
19
|
sides: SunburstSide[];
|
|
32
20
|
}
|
|
33
21
|
export interface SunburstSide {
|
|
@@ -48,10 +36,12 @@ export interface HierarchyNode {
|
|
|
48
36
|
roundName?: string;
|
|
49
37
|
scoreString?: string;
|
|
50
38
|
matchUpStatus?: string;
|
|
39
|
+
competitiveness?: CompetitivenessBucket;
|
|
51
40
|
matchUp?: SunburstMatchUp;
|
|
52
41
|
depth: number;
|
|
53
42
|
value?: number;
|
|
54
43
|
color?: string;
|
|
44
|
+
competitivenessColor?: string;
|
|
55
45
|
children?: HierarchyNode[];
|
|
56
46
|
opponent?: HierarchyNode;
|
|
57
47
|
}
|
|
@@ -63,6 +53,7 @@ export interface SegmentData {
|
|
|
63
53
|
nationalityCode?: string;
|
|
64
54
|
scoreString?: string;
|
|
65
55
|
matchUpStatus?: string;
|
|
56
|
+
competitiveness?: CompetitivenessBucket;
|
|
66
57
|
roundName?: string;
|
|
67
58
|
depth: number;
|
|
68
59
|
matchUp?: SunburstMatchUp;
|
|
@@ -71,11 +62,24 @@ export interface BurstChartEventHandlers {
|
|
|
71
62
|
clickSegment?: (data: SegmentData) => void;
|
|
72
63
|
clickCenter?: () => void;
|
|
73
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Determines how segments are filled.
|
|
67
|
+
* - 'default' — seed / entry-status / draw-position coloring (original behavior)
|
|
68
|
+
* - 'competitiveness' — winner-ring segments colored by the competitiveness
|
|
69
|
+
* bucket of the matchUp they represent; the outer entrant ring stays neutral.
|
|
70
|
+
*
|
|
71
|
+
* Modeled as an open string union so further modes can be added later.
|
|
72
|
+
*/
|
|
73
|
+
export type BurstColorMode = 'default' | 'competitiveness';
|
|
74
74
|
export interface BurstChartOptions {
|
|
75
75
|
width?: number;
|
|
76
76
|
height?: number;
|
|
77
77
|
title?: string;
|
|
78
78
|
colorBySeeds?: boolean;
|
|
79
|
+
/** Initial color mode (default 'default'). Toggle at runtime via instance.setColorMode(). */
|
|
80
|
+
colorMode?: BurstColorMode;
|
|
81
|
+
/** Override the default competitiveness bucket palette. */
|
|
82
|
+
competitivenessColors?: Partial<Record<CompetitivenessBucket, string>>;
|
|
79
83
|
countryCodes?: Record<string, string>;
|
|
80
84
|
eventHandlers?: BurstChartEventHandlers;
|
|
81
85
|
textScaleFactor?: number;
|
|
@@ -86,6 +90,8 @@ export interface BurstChartInstance {
|
|
|
86
90
|
highlightPlayer: (playerName?: string) => number;
|
|
87
91
|
/** Show or hide the entire chart SVG */
|
|
88
92
|
hide: (hidden: boolean) => void;
|
|
93
|
+
/** Switch the segment coloring mode in place (no re-render). */
|
|
94
|
+
setColorMode: (mode: BurstColorMode) => void;
|
|
89
95
|
}
|
|
90
96
|
/**
|
|
91
97
|
* Create a BurstChart D3v7 visualization.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { CompetitivenessBucket } from '../competitivenessBar/types';
|
|
2
|
+
export type CompetitiveBands = {
|
|
3
|
+
DECISIVE: number;
|
|
4
|
+
ROUTINE: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const DEFAULT_COMPETITIVE_BANDS: CompetitiveBands;
|
|
7
|
+
/** matchUpStatus values that represent a result with no games to measure. */
|
|
8
|
+
export declare const WALKOVER_STATUSES: Set<string>;
|
|
9
|
+
/** Default segment fill per bucket — matches the competitivenessBar/donut palette. */
|
|
10
|
+
export declare const COMPETITIVENESS_COLORS: Record<CompetitivenessBucket, string>;
|
|
11
|
+
/** Fill for segments with no measurable result (entrant ring, BYEs, undecided). */
|
|
12
|
+
export declare const NEUTRAL_SEGMENT_COLOR = "#cfd8dc";
|
|
13
|
+
interface ScoreSet {
|
|
14
|
+
side1Score?: number;
|
|
15
|
+
side2Score?: number;
|
|
16
|
+
side1TiebreakScore?: number;
|
|
17
|
+
side2TiebreakScore?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Classify a structured score (array of sets) into a competitiveness bucket.
|
|
21
|
+
* Returns undefined when there is nothing to measure (no sets / no games).
|
|
22
|
+
*/
|
|
23
|
+
export declare function getCompetitivenessBand(sets: ScoreSet[] | undefined, bands?: CompetitiveBands): CompetitivenessBucket | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Classify a score string (e.g. "6-2 7-6(2)") into a competitiveness bucket.
|
|
26
|
+
* Used by the legacy-draw adapter where only score strings are available.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getCompetitivenessFromScoreString(scoreString: string | undefined, bands?: CompetitiveBands): CompetitivenessBucket | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Single classification entry point used by both draw adapters. Prefers the
|
|
31
|
+
* structured score (`sets`); falls back to parsing a `scoreString`. Walkovers /
|
|
32
|
+
* defaults are bucketed by status since they carry no games.
|
|
33
|
+
*/
|
|
34
|
+
export declare function competitivenessForMatchUp({ winningSide, matchUpStatus, sets, scoreString, bands }: {
|
|
35
|
+
winningSide?: number;
|
|
36
|
+
matchUpStatus?: string;
|
|
37
|
+
sets?: ScoreSet[];
|
|
38
|
+
scoreString?: string;
|
|
39
|
+
bands?: CompetitiveBands;
|
|
40
|
+
}): CompetitivenessBucket | undefined;
|
|
41
|
+
/** Resolve the fill color for a bucket, honoring per-chart overrides. */
|
|
42
|
+
export declare function competitivenessColor(bucket: CompetitivenessBucket | undefined, overrides?: Partial<Record<CompetitivenessBucket, string>>): string;
|
|
43
|
+
export {};
|