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.
 
 
 

145 lines
2.2 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"],
  47. type: "map",
  48. mapKeys: ['spaceRatio'],
  49. states: {
  50. "0.2": [0.2],
  51. "0.5": [0.5],
  52. "1": [1],
  53. "1.5": [1.5]
  54. },
  55. activeState: "0.2"
  56. }
  57. ]
  58. },
  59. 'line-dotsize': {
  60. config: {
  61. data: sampleData[2],
  62. type: 'line',
  63. height: 140,
  64. colors: ['orange'],
  65. axisOptions: {
  66. xAxisMode: "tick"
  67. },
  68. lineOptions: {
  69. dotSize: 8
  70. }
  71. },
  72. options: [
  73. {
  74. name: "lineOptions",
  75. path: ["lineOptions"],
  76. type: "map",
  77. mapKeys: ['dotSize'],
  78. states: {
  79. "3": [3],
  80. "4": [4],
  81. "8": [8],
  82. "10": [10],
  83. },
  84. activeState: "8"
  85. }
  86. ]
  87. },
  88. 'line-trends-region-toggle': {
  89. config: {
  90. data: trendsData,
  91. type: 'line',
  92. height: 180,
  93. colors: ['violet'],
  94. axisOptions: {
  95. xAxisMode: 'tick',
  96. yAxisMode: 'span',
  97. xIsSeries: 1
  98. }
  99. },
  100. options: [
  101. {
  102. name: "lineOptions",
  103. path: ["lineOptions"],
  104. type: "map",
  105. mapKeys: ['hideLine', 'hideDots', 'heatline', 'regionFill'],
  106. states: {
  107. "Line": [0, 1, 0, 0],
  108. "Dots": [1, 0, 0, 0],
  109. "HeatLine": [0, 1, 1, 0],
  110. "Region": [0, 1, 0, 1]
  111. },
  112. activeState: "HeatLine"
  113. }
  114. ]
  115. },
  116. 'multi-dataset-line-bar': {
  117. config: {
  118. data: sampleData[1],
  119. type: 'line',
  120. height: 200,
  121. colors: ['green', 'light-green'],
  122. },
  123. options: [
  124. {
  125. name: "type",
  126. path: ["type"],
  127. type: "string",
  128. states: {
  129. "Line": 'line',
  130. "Bar": 'bar',
  131. },
  132. activeState: "Mixed"
  133. }
  134. ],
  135. },
  136. // '': {},
  137. };