@perses-dev/components 0.23.0 → 0.24.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 (152) hide show
  1. package/dist/ColorPicker/ColorPicker.d.ts +12 -0
  2. package/dist/ColorPicker/ColorPicker.d.ts.map +1 -0
  3. package/dist/ColorPicker/ColorPicker.js +78 -0
  4. package/dist/ColorPicker/ColorPicker.js.map +1 -0
  5. package/dist/ColorPicker/index.d.ts +2 -0
  6. package/dist/ColorPicker/index.d.ts.map +1 -0
  7. package/dist/ColorPicker/index.js +15 -0
  8. package/dist/ColorPicker/index.js.map +1 -0
  9. package/dist/EChart.d.ts +2 -2
  10. package/dist/EChart.d.ts.map +1 -1
  11. package/dist/EChart.js.map +1 -1
  12. package/dist/Legend/Legend.js +6 -9
  13. package/dist/Legend/Legend.js.map +1 -1
  14. package/dist/LineChart/LineChart.d.ts +4 -2
  15. package/dist/LineChart/LineChart.d.ts.map +1 -1
  16. package/dist/LineChart/LineChart.js +1 -1
  17. package/dist/LineChart/LineChart.js.map +1 -1
  18. package/dist/OptionsEditorLayout/OptionsEditorControl.js +1 -1
  19. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  20. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +3 -2
  21. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
  22. package/dist/OptionsEditorLayout/OptionsEditorGroup.js +17 -5
  23. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
  24. package/dist/StatChart/StatChart.d.ts +0 -1
  25. package/dist/StatChart/StatChart.d.ts.map +1 -1
  26. package/dist/StatChart/StatChart.js +1 -3
  27. package/dist/StatChart/StatChart.js.map +1 -1
  28. package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts +4 -0
  29. package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts.map +1 -0
  30. package/dist/ThresholdsEditor/ThresholdColorPicker.js +76 -0
  31. package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +1 -0
  32. package/dist/ThresholdsEditor/ThresholdInput.d.ts +13 -0
  33. package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -0
  34. package/dist/ThresholdsEditor/ThresholdInput.js +61 -0
  35. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -0
  36. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts +10 -0
  37. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -0
  38. package/dist/ThresholdsEditor/ThresholdsEditor.js +215 -0
  39. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -0
  40. package/dist/ThresholdsEditor/index.d.ts +2 -0
  41. package/dist/ThresholdsEditor/index.d.ts.map +1 -0
  42. package/dist/ThresholdsEditor/index.js +15 -0
  43. package/dist/ThresholdsEditor/index.js.map +1 -0
  44. package/dist/TimeSeriesTooltip/focused-series.d.ts.map +1 -1
  45. package/dist/TimeSeriesTooltip/focused-series.js +3 -3
  46. package/dist/TimeSeriesTooltip/focused-series.js.map +1 -1
  47. package/dist/cjs/ColorPicker/ColorPicker.js +128 -0
  48. package/dist/cjs/{model/legend.test.js → ColorPicker/index.js} +11 -12
  49. package/dist/cjs/Legend/Legend.js +5 -8
  50. package/dist/cjs/LineChart/LineChart.js +40 -1
  51. package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +1 -1
  52. package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +22 -5
  53. package/dist/cjs/StatChart/StatChart.js +1 -41
  54. package/dist/cjs/ThresholdsEditor/ThresholdColorPicker.js +87 -0
  55. package/dist/cjs/ThresholdsEditor/ThresholdInput.js +72 -0
  56. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +265 -0
  57. package/dist/{model/legend.test.js → cjs/ThresholdsEditor/index.js} +15 -14
  58. package/dist/cjs/TimeSeriesTooltip/focused-series.js +3 -3
  59. package/dist/cjs/index.js +2 -0
  60. package/dist/cjs/test-utils/theme.js +8 -0
  61. package/dist/cjs/theme/theme.js +5 -0
  62. package/dist/cjs/utils/theme-gen.js +8 -0
  63. package/dist/index.d.ts +2 -0
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +2 -0
  66. package/dist/index.js.map +1 -1
  67. package/dist/model/graph.d.ts +2 -2
  68. package/dist/model/graph.d.ts.map +1 -1
  69. package/dist/model/graph.js.map +1 -1
  70. package/dist/model/legend.d.ts +1 -1
  71. package/dist/model/legend.d.ts.map +1 -1
  72. package/dist/model/legend.js.map +1 -1
  73. package/dist/model/theme.d.ts +5 -0
  74. package/dist/model/theme.d.ts.map +1 -1
  75. package/dist/model/theme.js.map +1 -1
  76. package/dist/model/units/bytes.d.ts +1 -1
  77. package/dist/model/units/bytes.d.ts.map +1 -1
  78. package/dist/model/units/bytes.js.map +1 -1
  79. package/dist/model/units/decimal.d.ts +1 -1
  80. package/dist/model/units/decimal.d.ts.map +1 -1
  81. package/dist/model/units/decimal.js.map +1 -1
  82. package/dist/model/units/percent.d.ts +1 -1
  83. package/dist/model/units/percent.d.ts.map +1 -1
  84. package/dist/model/units/percent.js.map +1 -1
  85. package/dist/model/units/time.d.ts +1 -1
  86. package/dist/model/units/time.d.ts.map +1 -1
  87. package/dist/model/units/time.js.map +1 -1
  88. package/dist/model/units/types.d.ts +1 -1
  89. package/dist/model/units/types.d.ts.map +1 -1
  90. package/dist/model/units/types.js.map +1 -1
  91. package/dist/test-utils/theme.d.ts.map +1 -1
  92. package/dist/test-utils/theme.js +8 -0
  93. package/dist/test-utils/theme.js.map +1 -1
  94. package/dist/theme/theme.js +5 -0
  95. package/dist/theme/theme.js.map +1 -1
  96. package/dist/utils/theme-gen.d.ts.map +1 -1
  97. package/dist/utils/theme-gen.js +8 -0
  98. package/dist/utils/theme-gen.js.map +1 -1
  99. package/package.json +5 -3
  100. package/dist/InfoTooltip/InfoTooltip.test.d.ts +0 -2
  101. package/dist/InfoTooltip/InfoTooltip.test.d.ts.map +0 -1
  102. package/dist/InfoTooltip/InfoTooltip.test.js +0 -36
  103. package/dist/InfoTooltip/InfoTooltip.test.js.map +0 -1
  104. package/dist/LegendOptionsEditor/LegendOptionsEditor.test.d.ts +0 -2
  105. package/dist/LegendOptionsEditor/LegendOptionsEditor.test.d.ts.map +0 -1
  106. package/dist/LegendOptionsEditor/LegendOptionsEditor.test.js +0 -62
  107. package/dist/LegendOptionsEditor/LegendOptionsEditor.test.js.map +0 -1
  108. package/dist/StatChart/StatChart.test.d.ts +0 -2
  109. package/dist/StatChart/StatChart.test.d.ts.map +0 -1
  110. package/dist/StatChart/StatChart.test.js +0 -94
  111. package/dist/StatChart/StatChart.test.js.map +0 -1
  112. package/dist/TimeSeriesTooltip/SeriesInfo.test.d.ts +0 -2
  113. package/dist/TimeSeriesTooltip/SeriesInfo.test.d.ts.map +0 -1
  114. package/dist/TimeSeriesTooltip/SeriesInfo.test.js +0 -52
  115. package/dist/TimeSeriesTooltip/SeriesInfo.test.js.map +0 -1
  116. package/dist/TimeSeriesTooltip/TooltipContent.test.d.ts +0 -2
  117. package/dist/TimeSeriesTooltip/TooltipContent.test.d.ts.map +0 -1
  118. package/dist/TimeSeriesTooltip/TooltipContent.test.js +0 -78
  119. package/dist/TimeSeriesTooltip/TooltipContent.test.js.map +0 -1
  120. package/dist/TimeSeriesTooltip/focused-series.test.d.ts +0 -2
  121. package/dist/TimeSeriesTooltip/focused-series.test.d.ts.map +0 -1
  122. package/dist/TimeSeriesTooltip/focused-series.test.js +0 -93
  123. package/dist/TimeSeriesTooltip/focused-series.test.js.map +0 -1
  124. package/dist/UnitSelector/UnitSelector.test.d.ts +0 -2
  125. package/dist/UnitSelector/UnitSelector.test.d.ts.map +0 -1
  126. package/dist/UnitSelector/UnitSelector.test.js +0 -204
  127. package/dist/UnitSelector/UnitSelector.test.js.map +0 -1
  128. package/dist/cjs/InfoTooltip/InfoTooltip.test.js +0 -43
  129. package/dist/cjs/LegendOptionsEditor/LegendOptionsEditor.test.js +0 -69
  130. package/dist/cjs/StatChart/StatChart.test.js +0 -96
  131. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.test.js +0 -54
  132. package/dist/cjs/TimeSeriesTooltip/TooltipContent.test.js +0 -80
  133. package/dist/cjs/TimeSeriesTooltip/focused-series.test.js +0 -95
  134. package/dist/cjs/UnitSelector/UnitSelector.test.js +0 -211
  135. package/dist/cjs/model/units/units.test.js +0 -206
  136. package/dist/cjs/utils/format.test.js +0 -47
  137. package/dist/cjs/utils/theme-gen.test.js +0 -202
  138. package/dist/model/legend.test.d.ts +0 -2
  139. package/dist/model/legend.test.d.ts.map +0 -1
  140. package/dist/model/legend.test.js.map +0 -1
  141. package/dist/model/units/units.test.d.ts +0 -2
  142. package/dist/model/units/units.test.d.ts.map +0 -1
  143. package/dist/model/units/units.test.js +0 -204
  144. package/dist/model/units/units.test.js.map +0 -1
  145. package/dist/utils/format.test.d.ts +0 -2
  146. package/dist/utils/format.test.d.ts.map +0 -1
  147. package/dist/utils/format.test.js +0 -45
  148. package/dist/utils/format.test.js.map +0 -1
  149. package/dist/utils/theme-gen.test.d.ts +0 -2
  150. package/dist/utils/theme-gen.test.d.ts.map +0 -1
  151. package/dist/utils/theme-gen.test.js +0 -200
  152. package/dist/utils/theme-gen.test.js.map +0 -1
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=format.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format.test.d.ts","sourceRoot":"","sources":["../../src/utils/format.test.ts"],"names":[],"mappings":""}
@@ -1,45 +0,0 @@
1
- // Copyright 2023 The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- import { dateFormatOptionsWithTimeZone, formatWithTimeZone } from './format';
14
- const DATE = new Date(168523200000);
15
- const DATE_FORMAT_OPTIONS = {
16
- hour: 'numeric',
17
- minute: 'numeric',
18
- hourCycle: 'h23'
19
- };
20
- describe('formatWithTimeZone', ()=>{
21
- it('should format in Los Angeles timezone', ()=>{
22
- expect(formatWithTimeZone(DATE, 'yyyy-MM-dd HH:mm:ss', 'America/Los_Angeles')).toBe('1975-05-05 05:00:00');
23
- });
24
- it('should format in UTC timezone', ()=>{
25
- expect(formatWithTimeZone(DATE, 'yyyy-MM-dd HH:mm:ss', 'UTC')).toBe('1975-05-05 12:00:00');
26
- expect(formatWithTimeZone(DATE, 'yyyy-MM-dd HH:mm:ss', 'utc')).toBe('1975-05-05 12:00:00');
27
- });
28
- });
29
- describe('dateFormatOptionsWithTimeZone', ()=>{
30
- it('should format in Los Angeles timezone', ()=>{
31
- const dateFormatOptions = dateFormatOptionsWithTimeZone(DATE_FORMAT_OPTIONS, 'America/Los_Angeles');
32
- expect(new Intl.DateTimeFormat(undefined, dateFormatOptions).format(DATE)).toBe('05:00');
33
- });
34
- it('should format in UTC timezone', ()=>{
35
- const dateFormatOptions = dateFormatOptionsWithTimeZone(DATE_FORMAT_OPTIONS, 'utc');
36
- expect(new Intl.DateTimeFormat(undefined, dateFormatOptions).format(DATE)).toBe('12:00');
37
- });
38
- it('should use browser local timezone', ()=>{
39
- expect(dateFormatOptionsWithTimeZone(DATE_FORMAT_OPTIONS, 'browser').timeZone).toBeUndefined();
40
- expect(dateFormatOptionsWithTimeZone(DATE_FORMAT_OPTIONS, 'local').timeZone).toBeUndefined();
41
- expect(dateFormatOptionsWithTimeZone(DATE_FORMAT_OPTIONS).timeZone).toBeUndefined();
42
- });
43
- });
44
-
45
- //# sourceMappingURL=format.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/format.test.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\nimport { dateFormatOptionsWithTimeZone, formatWithTimeZone } from './format';\n\nconst DATE = new Date(168523200000);\n\nconst DATE_FORMAT_OPTIONS: Intl.DateTimeFormatOptions = {\n hour: 'numeric',\n minute: 'numeric',\n hourCycle: 'h23',\n};\n\ndescribe('formatWithTimeZone', () => {\n it('should format in Los Angeles timezone', () => {\n expect(formatWithTimeZone(DATE, 'yyyy-MM-dd HH:mm:ss', 'America/Los_Angeles')).toBe('1975-05-05 05:00:00');\n });\n it('should format in UTC timezone', () => {\n expect(formatWithTimeZone(DATE, 'yyyy-MM-dd HH:mm:ss', 'UTC')).toBe('1975-05-05 12:00:00');\n expect(formatWithTimeZone(DATE, 'yyyy-MM-dd HH:mm:ss', 'utc')).toBe('1975-05-05 12:00:00');\n });\n});\n\ndescribe('dateFormatOptionsWithTimeZone', () => {\n it('should format in Los Angeles timezone', () => {\n const dateFormatOptions = dateFormatOptionsWithTimeZone(DATE_FORMAT_OPTIONS, 'America/Los_Angeles');\n expect(new Intl.DateTimeFormat(undefined, dateFormatOptions).format(DATE)).toBe('05:00');\n });\n it('should format in UTC timezone', () => {\n const dateFormatOptions = dateFormatOptionsWithTimeZone(DATE_FORMAT_OPTIONS, 'utc');\n expect(new Intl.DateTimeFormat(undefined, dateFormatOptions).format(DATE)).toBe('12:00');\n });\n it('should use browser local timezone', () => {\n expect(dateFormatOptionsWithTimeZone(DATE_FORMAT_OPTIONS, 'browser').timeZone).toBeUndefined();\n expect(dateFormatOptionsWithTimeZone(DATE_FORMAT_OPTIONS, 'local').timeZone).toBeUndefined();\n expect(dateFormatOptionsWithTimeZone(DATE_FORMAT_OPTIONS).timeZone).toBeUndefined();\n });\n});\n"],"names":["dateFormatOptionsWithTimeZone","formatWithTimeZone","DATE","Date","DATE_FORMAT_OPTIONS","hour","minute","hourCycle","describe","it","expect","toBe","dateFormatOptions","Intl","DateTimeFormat","undefined","format","timeZone","toBeUndefined"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,SAASA,6BAA6B,EAAEC,kBAAkB,QAAQ,UAAU,CAAC;AAE7E,MAAMC,IAAI,GAAG,IAAIC,IAAI,CAAC,YAAY,CAAC,AAAC;AAEpC,MAAMC,mBAAmB,GAA+B;IACtDC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE,SAAS;IACjBC,SAAS,EAAE,KAAK;CACjB,AAAC;AAEFC,QAAQ,CAAC,oBAAoB,EAAE,IAAM;IACnCC,EAAE,CAAC,uCAAuC,EAAE,IAAM;QAChDC,MAAM,CAACT,kBAAkB,CAACC,IAAI,EAAE,qBAAqB,EAAE,qBAAqB,CAAC,CAAC,CAACS,IAAI,CAAC,qBAAqB,CAAC,CAAC;IAC7G,CAAC,CAAC,CAAC;IACHF,EAAE,CAAC,+BAA+B,EAAE,IAAM;QACxCC,MAAM,CAACT,kBAAkB,CAACC,IAAI,EAAE,qBAAqB,EAAE,KAAK,CAAC,CAAC,CAACS,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAC3FD,MAAM,CAACT,kBAAkB,CAACC,IAAI,EAAE,qBAAqB,EAAE,KAAK,CAAC,CAAC,CAACS,IAAI,CAAC,qBAAqB,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEHH,QAAQ,CAAC,+BAA+B,EAAE,IAAM;IAC9CC,EAAE,CAAC,uCAAuC,EAAE,IAAM;QAChD,MAAMG,iBAAiB,GAAGZ,6BAA6B,CAACI,mBAAmB,EAAE,qBAAqB,CAAC,AAAC;QACpGM,MAAM,CAAC,IAAIG,IAAI,CAACC,cAAc,CAACC,SAAS,EAAEH,iBAAiB,CAAC,CAACI,MAAM,CAACd,IAAI,CAAC,CAAC,CAACS,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;IACHF,EAAE,CAAC,+BAA+B,EAAE,IAAM;QACxC,MAAMG,iBAAiB,GAAGZ,6BAA6B,CAACI,mBAAmB,EAAE,KAAK,CAAC,AAAC;QACpFM,MAAM,CAAC,IAAIG,IAAI,CAACC,cAAc,CAACC,SAAS,EAAEH,iBAAiB,CAAC,CAACI,MAAM,CAACd,IAAI,CAAC,CAAC,CAACS,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;IACHF,EAAE,CAAC,mCAAmC,EAAE,IAAM;QAC5CC,MAAM,CAACV,6BAA6B,CAACI,mBAAmB,EAAE,SAAS,CAAC,CAACa,QAAQ,CAAC,CAACC,aAAa,EAAE,CAAC;QAC/FR,MAAM,CAACV,6BAA6B,CAACI,mBAAmB,EAAE,OAAO,CAAC,CAACa,QAAQ,CAAC,CAACC,aAAa,EAAE,CAAC;QAC7FR,MAAM,CAACV,6BAA6B,CAACI,mBAAmB,CAAC,CAACa,QAAQ,CAAC,CAACC,aAAa,EAAE,CAAC;IACtF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=theme-gen.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme-gen.test.d.ts","sourceRoot":"","sources":["../../src/utils/theme-gen.test.ts"],"names":[],"mappings":""}
@@ -1,200 +0,0 @@
1
- // Copyright 2023 The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- import { createTheme } from '@mui/material';
14
- import { generateChartsTheme } from './theme-gen';
15
- describe('generateChartsTheme', ()=>{
16
- const muiTheme = createTheme({});
17
- const echartsThemeOverrides = {
18
- legend: {
19
- textStyle: {
20
- color: 'yellow'
21
- }
22
- },
23
- line: {
24
- showSymbol: true,
25
- smooth: true
26
- }
27
- };
28
- const chartsTheme = generateChartsTheme(muiTheme, echartsThemeOverrides);
29
- it('should return perses specific charts theme from converted MUI theme', ()=>{
30
- expect(chartsTheme).toMatchInlineSnapshot(`
31
- Object {
32
- "container": Object {
33
- "padding": Object {
34
- "default": 12,
35
- },
36
- },
37
- "echartsTheme": Object {
38
- "bar": Object {
39
- "barMaxWidth": 150,
40
- "itemStyle": Object {
41
- "borderColor": "#e0e0e0",
42
- "borderWidth": 0,
43
- },
44
- },
45
- "categoryAxis": Object {
46
- "axisLabel": Object {
47
- "color": "rgba(0, 0, 0, 0.87)",
48
- "margin": 15,
49
- "show": true,
50
- },
51
- "axisLine": Object {
52
- "lineStyle": Object {
53
- "color": "#757575",
54
- },
55
- "show": true,
56
- },
57
- "axisTick": Object {
58
- "length": 6,
59
- "lineStyle": Object {
60
- "color": "#757575",
61
- },
62
- "show": false,
63
- },
64
- "show": true,
65
- "splitArea": Object {
66
- "areaStyle": Object {
67
- "color": Array [
68
- "#e0e0e0",
69
- ],
70
- },
71
- "show": false,
72
- },
73
- "splitLine": Object {
74
- "lineStyle": Object {
75
- "color": "#e0e0e0",
76
- "opacity": 0.6,
77
- "width": 0.5,
78
- },
79
- "show": true,
80
- },
81
- },
82
- "color": Array [
83
- "#8dd3c7",
84
- "#bebada",
85
- "#fb8072",
86
- "#80b1d3",
87
- "#fdb462",
88
- ],
89
- "gauge": Object {
90
- "detail": Object {
91
- "fontSize": 18,
92
- "fontWeight": 600,
93
- "valueAnimation": false,
94
- },
95
- "splitLine": Object {
96
- "distance": 0,
97
- "length": 4,
98
- "lineStyle": Object {
99
- "width": 1,
100
- },
101
- },
102
- "splitNumber": 12,
103
- },
104
- "grid": Object {
105
- "bottom": 0,
106
- "containLabel": true,
107
- "left": 20,
108
- "right": 20,
109
- "top": 5,
110
- },
111
- "legend": Object {
112
- "orient": "horizontal",
113
- "pageIconColor": "rgba(0, 0, 0, 0.54)",
114
- "pageIconInactiveColor": "rgba(0, 0, 0, 0.26)",
115
- "pageTextStyle": Object {
116
- "color": "#757575",
117
- },
118
- "textStyle": Object {
119
- "color": "yellow",
120
- },
121
- },
122
- "line": Object {
123
- "emphasis": Object {
124
- "lineStyle": Object {
125
- "width": 1.5,
126
- },
127
- },
128
- "lineStyle": Object {
129
- "width": 1,
130
- },
131
- "showSymbol": true,
132
- "smooth": true,
133
- "symbol": "circle",
134
- "symbolSize": 4,
135
- },
136
- "textStyle": Object {
137
- "color": "rgba(0, 0, 0, 0.87)",
138
- "fontFamily": "\\"Roboto\\", \\"Helvetica\\", \\"Arial\\", sans-serif",
139
- "fontSize": 12,
140
- },
141
- "title": Object {
142
- "show": false,
143
- },
144
- "toolbox": Object {
145
- "iconStyle": Object {
146
- "borderColor": "rgba(0, 0, 0, 0.87)",
147
- },
148
- "right": 10,
149
- "show": true,
150
- "top": 10,
151
- },
152
- "tooltip": Object {},
153
- "valueAxis": Object {
154
- "axisLabel": Object {
155
- "color": "rgba(0, 0, 0, 0.87)",
156
- "margin": 12,
157
- },
158
- "axisLine": Object {
159
- "show": false,
160
- },
161
- "show": true,
162
- "splitLine": Object {
163
- "lineStyle": Object {
164
- "color": "#e0e0e0",
165
- "opacity": 0.6,
166
- "width": 0.5,
167
- },
168
- "show": true,
169
- },
170
- },
171
- },
172
- "noDataOption": Object {
173
- "title": Object {
174
- "left": "center",
175
- "show": true,
176
- "text": "No data",
177
- "textStyle": Object {
178
- "color": "rgba(0, 0, 0, 0.87)",
179
- "fontSize": 16,
180
- "fontWeight": 400,
181
- },
182
- "top": "center",
183
- },
184
- "xAxis": Object {
185
- "show": false,
186
- },
187
- "yAxis": Object {
188
- "show": false,
189
- },
190
- },
191
- "sparkline": Object {
192
- "color": "#1976d2",
193
- "width": 2,
194
- },
195
- }
196
- `);
197
- });
198
- });
199
-
200
- //# sourceMappingURL=theme-gen.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/theme-gen.test.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { createTheme } from '@mui/material';\nimport { EChartsTheme, PersesChartsTheme } from '../model';\nimport { generateChartsTheme } from './theme-gen';\n\ndescribe('generateChartsTheme', () => {\n const muiTheme = createTheme({});\n const echartsThemeOverrides: EChartsTheme = {\n legend: {\n textStyle: {\n color: 'yellow',\n },\n },\n line: {\n showSymbol: true,\n smooth: true,\n },\n };\n const chartsTheme: PersesChartsTheme = generateChartsTheme(muiTheme, echartsThemeOverrides);\n\n it('should return perses specific charts theme from converted MUI theme', () => {\n expect(chartsTheme).toMatchInlineSnapshot(`\n Object {\n \"container\": Object {\n \"padding\": Object {\n \"default\": 12,\n },\n },\n \"echartsTheme\": Object {\n \"bar\": Object {\n \"barMaxWidth\": 150,\n \"itemStyle\": Object {\n \"borderColor\": \"#e0e0e0\",\n \"borderWidth\": 0,\n },\n },\n \"categoryAxis\": Object {\n \"axisLabel\": Object {\n \"color\": \"rgba(0, 0, 0, 0.87)\",\n \"margin\": 15,\n \"show\": true,\n },\n \"axisLine\": Object {\n \"lineStyle\": Object {\n \"color\": \"#757575\",\n },\n \"show\": true,\n },\n \"axisTick\": Object {\n \"length\": 6,\n \"lineStyle\": Object {\n \"color\": \"#757575\",\n },\n \"show\": false,\n },\n \"show\": true,\n \"splitArea\": Object {\n \"areaStyle\": Object {\n \"color\": Array [\n \"#e0e0e0\",\n ],\n },\n \"show\": false,\n },\n \"splitLine\": Object {\n \"lineStyle\": Object {\n \"color\": \"#e0e0e0\",\n \"opacity\": 0.6,\n \"width\": 0.5,\n },\n \"show\": true,\n },\n },\n \"color\": Array [\n \"#8dd3c7\",\n \"#bebada\",\n \"#fb8072\",\n \"#80b1d3\",\n \"#fdb462\",\n ],\n \"gauge\": Object {\n \"detail\": Object {\n \"fontSize\": 18,\n \"fontWeight\": 600,\n \"valueAnimation\": false,\n },\n \"splitLine\": Object {\n \"distance\": 0,\n \"length\": 4,\n \"lineStyle\": Object {\n \"width\": 1,\n },\n },\n \"splitNumber\": 12,\n },\n \"grid\": Object {\n \"bottom\": 0,\n \"containLabel\": true,\n \"left\": 20,\n \"right\": 20,\n \"top\": 5,\n },\n \"legend\": Object {\n \"orient\": \"horizontal\",\n \"pageIconColor\": \"rgba(0, 0, 0, 0.54)\",\n \"pageIconInactiveColor\": \"rgba(0, 0, 0, 0.26)\",\n \"pageTextStyle\": Object {\n \"color\": \"#757575\",\n },\n \"textStyle\": Object {\n \"color\": \"yellow\",\n },\n },\n \"line\": Object {\n \"emphasis\": Object {\n \"lineStyle\": Object {\n \"width\": 1.5,\n },\n },\n \"lineStyle\": Object {\n \"width\": 1,\n },\n \"showSymbol\": true,\n \"smooth\": true,\n \"symbol\": \"circle\",\n \"symbolSize\": 4,\n },\n \"textStyle\": Object {\n \"color\": \"rgba(0, 0, 0, 0.87)\",\n \"fontFamily\": \"\\\\\"Roboto\\\\\", \\\\\"Helvetica\\\\\", \\\\\"Arial\\\\\", sans-serif\",\n \"fontSize\": 12,\n },\n \"title\": Object {\n \"show\": false,\n },\n \"toolbox\": Object {\n \"iconStyle\": Object {\n \"borderColor\": \"rgba(0, 0, 0, 0.87)\",\n },\n \"right\": 10,\n \"show\": true,\n \"top\": 10,\n },\n \"tooltip\": Object {},\n \"valueAxis\": Object {\n \"axisLabel\": Object {\n \"color\": \"rgba(0, 0, 0, 0.87)\",\n \"margin\": 12,\n },\n \"axisLine\": Object {\n \"show\": false,\n },\n \"show\": true,\n \"splitLine\": Object {\n \"lineStyle\": Object {\n \"color\": \"#e0e0e0\",\n \"opacity\": 0.6,\n \"width\": 0.5,\n },\n \"show\": true,\n },\n },\n },\n \"noDataOption\": Object {\n \"title\": Object {\n \"left\": \"center\",\n \"show\": true,\n \"text\": \"No data\",\n \"textStyle\": Object {\n \"color\": \"rgba(0, 0, 0, 0.87)\",\n \"fontSize\": 16,\n \"fontWeight\": 400,\n },\n \"top\": \"center\",\n },\n \"xAxis\": Object {\n \"show\": false,\n },\n \"yAxis\": Object {\n \"show\": false,\n },\n },\n \"sparkline\": Object {\n \"color\": \"#1976d2\",\n \"width\": 2,\n },\n }\n `);\n });\n});\n"],"names":["createTheme","generateChartsTheme","describe","muiTheme","echartsThemeOverrides","legend","textStyle","color","line","showSymbol","smooth","chartsTheme","it","expect","toMatchInlineSnapshot"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,QAAQ,eAAe,CAAC;AAE5C,SAASC,mBAAmB,QAAQ,aAAa,CAAC;AAElDC,QAAQ,CAAC,qBAAqB,EAAE,IAAM;IACpC,MAAMC,QAAQ,GAAGH,WAAW,CAAC,EAAE,CAAC,AAAC;IACjC,MAAMI,qBAAqB,GAAiB;QAC1CC,MAAM,EAAE;YACNC,SAAS,EAAE;gBACTC,KAAK,EAAE,QAAQ;aAChB;SACF;QACDC,IAAI,EAAE;YACJC,UAAU,EAAE,IAAI;YAChBC,MAAM,EAAE,IAAI;SACb;KACF,AAAC;IACF,MAAMC,WAAW,GAAsBV,mBAAmB,CAACE,QAAQ,EAAEC,qBAAqB,CAAC,AAAC;IAE5FQ,EAAE,CAAC,qEAAqE,EAAE,IAAM;QAC9EC,MAAM,CAACF,WAAW,CAAC,CAACG,qBAAqB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsK3C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}