You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

141 lines
2.1 KiB

  1. import { sampleData, trendsData } from './assets/js/data';
  2. export const demoRegistry = {
  3. 'bar-basic-1': {
  4. config: {
  5. data: sampleData[0],
  6. type: 'bar',
  7. height: 140,
  8. colors: ['red'],
  9. }
  10. },
  11. 'line-basic-1': {
  12. config: {
  13. data: sampleData[0],
  14. type: 'line',
  15. height: 140,
  16. colors: ['red'],
  17. }
  18. },
  19. 'bar-axis-tick': {
  20. config: {
  21. data: sampleData[2],
  22. type: 'bar',
  23. height: 140,
  24. colors: ['blue'],
  25. axisOptions: {
  26. xAxisMode: "tick",
  27. },
  28. },
  29. },
  30. 'bar-barwidth': {
  31. config: {
  32. data: sampleData[3],
  33. type: 'bar',
  34. height: 140,
  35. colors: ['orange'],
  36. axisOptions: {
  37. xAxisMode: "tick"
  38. },
  39. barOptions: {
  40. spaceRatio: 0.2
  41. },
  42. },
  43. options: [
  44. {
  45. name: "barOptions",
  46. path: ["barOptions", "spaceRatio"],
  47. type: "number",
  48. numberOptions: {
  49. min: 0.1,
  50. max: 1.9,
  51. step: 0.1,
  52. },
  53. activeState: 0.2
  54. }
  55. ]
  56. },
  57. 'line-dotsize': {
  58. config: {
  59. data: sampleData[2],
  60. type: 'line',
  61. height: 140,
  62. colors: ['orange'],
  63. axisOptions: {
  64. xAxisMode: "tick"
  65. },
  66. lineOptions: {
  67. dotSize: 8
  68. }
  69. },
  70. options: [
  71. {
  72. name: "lineOptions",
  73. path: ["lineOptions", "dotSize"],
  74. type: "number",
  75. numberOptions: {
  76. min: 3,
  77. max: 10,
  78. step: 1
  79. },
  80. activeState: 8
  81. }
  82. ]
  83. },
  84. 'line-trends-region-toggle': {
  85. config: {
  86. data: trendsData,
  87. type: 'line',
  88. height: 180,
  89. colors: ['violet'],
  90. axisOptions: {
  91. xAxisMode: 'tick',
  92. yAxisMode: 'span',
  93. xIsSeries: 1
  94. }
  95. },
  96. options: [
  97. {
  98. name: "lineOptions",
  99. path: ["lineOptions"],
  100. type: "map",
  101. mapKeys: ['hideLine', 'hideDots', 'heatline', 'regionFill'],
  102. states: {
  103. "Line": [0, 1, 0, 0],
  104. "Dots": [1, 0, 0, 0],
  105. "HeatLine": [0, 1, 1, 0],
  106. "Region": [0, 1, 0, 1]
  107. },
  108. activeState: "HeatLine"
  109. }
  110. ]
  111. },
  112. 'multi-dataset-line-bar': {
  113. config: {
  114. data: sampleData[1],
  115. type: 'line',
  116. height: 200,
  117. colors: ['green', 'light-green'],
  118. },
  119. options: [
  120. {
  121. name: "type",
  122. path: ["type"],
  123. type: "string",
  124. states: {
  125. "Line": 'line',
  126. "Bar": 'bar',
  127. },
  128. activeState: "Mixed"
  129. }
  130. ],
  131. },
  132. // '': {},
  133. };