mockSliceEntities.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. import { datasourceId } from 'spec/fixtures/mockDatasource';
  20. import { DatasourceType, VizType } from '@superset-ui/core';
  21. import { sliceId } from './mockChartQueries';
  22. export const filterId = 127;
  23. export const column = 'region';
  24. export const sliceEntitiesForChart = {
  25. slices: {
  26. [sliceId]: {
  27. slice_id: sliceId,
  28. slice_url: '/explore/?form_data=%7B%22slice_id%22%3A%2018%7D',
  29. slice_name: 'Genders',
  30. form_data: {
  31. slice_id: sliceId,
  32. viz_type: VizType.Pie,
  33. row_limit: 50000,
  34. metric: 'sum__num',
  35. since: '100 years ago',
  36. groupby: ['gender'],
  37. metrics: ['sum__num'],
  38. compare_lag: '10',
  39. limit: '25',
  40. until: 'now',
  41. granularity: 'ds',
  42. markup_type: 'markdown',
  43. where: '',
  44. compare_suffix: 'o10Y',
  45. datasource: datasourceId,
  46. },
  47. viz_type: VizType.Pie,
  48. datasource: datasourceId,
  49. description: '',
  50. description_markdown: '',
  51. modified: '23 hours ago',
  52. changed_on: 1529453332615,
  53. },
  54. },
  55. isLoading: false,
  56. errorMessage: null,
  57. lastUpdated: 0,
  58. };
  59. export const sliceEntitiesForDashboard = {
  60. slices: {
  61. [filterId]: {
  62. slice_id: filterId,
  63. slice_url: '/explore/?form_data=%7B%22slice_id%22%3A%20127%7D',
  64. slice_name: 'Region Filter',
  65. form_data: {
  66. instant_filtering: true,
  67. filter_configs: [
  68. {
  69. asc: true,
  70. clearable: true,
  71. column,
  72. key: 'JknLrSlNL',
  73. multiple: true,
  74. label: column,
  75. },
  76. ],
  77. },
  78. viz_type: 'filter_box',
  79. datasource: '2__table',
  80. description: '',
  81. description_markdown: '',
  82. modified: '23 hours ago',
  83. changed_on: 1529453332615,
  84. changed_on_humanized: '',
  85. datasource_id: 0,
  86. datasource_type: DatasourceType.Query,
  87. datasource_url: '',
  88. datasource_name: '',
  89. owners: [{ id: 0 }],
  90. created_by: { id: 0 },
  91. thumbnail_url: '',
  92. },
  93. 128: {
  94. slice_id: 128,
  95. slice_url: '/explore/?form_data=%7B%22slice_id%22%3A%20128%7D',
  96. slice_name: "World's Population",
  97. form_data: {},
  98. viz_type: VizType.BigNumber,
  99. datasource: '2__table',
  100. description: '',
  101. description_markdown: '',
  102. modified: '23 hours ago',
  103. changed_on: 1529453332628,
  104. changed_on_humanized: '',
  105. datasource_id: 0,
  106. datasource_type: DatasourceType.Query,
  107. datasource_url: '',
  108. datasource_name: '',
  109. owners: [{ id: 0 }],
  110. created_by: { id: 0 },
  111. thumbnail_url: '',
  112. },
  113. 129: {
  114. slice_id: 129,
  115. slice_url: '/explore/?form_data=%7B%22slice_id%22%3A%20129%7D',
  116. slice_name: 'Most Populated Countries',
  117. form_data: {},
  118. viz_type: VizType.Table,
  119. datasource: '2__table',
  120. description: '',
  121. description_markdown: 'dd',
  122. modified: '23 hours ago',
  123. changed_on: 1529453332637,
  124. changed_on_humanized: '',
  125. datasource_id: 0,
  126. datasource_type: DatasourceType.Query,
  127. datasource_url: '',
  128. datasource_name: '',
  129. owners: [{ id: 0 }],
  130. created_by: { id: 0 },
  131. thumbnail_url: '',
  132. },
  133. 130: {
  134. slice_id: 130,
  135. slice_url: '/explore/?form_data=%7B%22slice_id%22%3A%20130%7D',
  136. slice_name: 'Growth Rate',
  137. form_data: {},
  138. viz_type: VizType.Line,
  139. datasource: '2__table',
  140. description: '',
  141. description_markdown: '',
  142. modified: '23 hours ago',
  143. changed_on: 1529453332645,
  144. changed_on_humanized: '',
  145. datasource_id: 0,
  146. datasource_type: DatasourceType.SlTable,
  147. datasource_url: '',
  148. datasource_name: '',
  149. owners: [{ id: 0 }],
  150. created_by: { id: 0 },
  151. thumbnail_url: '',
  152. },
  153. 131: {
  154. slice_id: 131,
  155. slice_url: '/explore/?form_data=%7B%22slice_id%22%3A%20131%7D',
  156. slice_name: '% Rural',
  157. form_data: {},
  158. viz_type: VizType.WorldMap,
  159. datasource: '2__table',
  160. description: '',
  161. description_markdown: '',
  162. modified: '23 hours ago',
  163. changed_on: 1529453332654,
  164. changed_on_humanized: '',
  165. datasource_id: 0,
  166. datasource_type: DatasourceType.Table,
  167. datasource_url: '',
  168. datasource_name: '',
  169. owners: [{ id: 0 }],
  170. created_by: { id: 0 },
  171. thumbnail_url: '',
  172. },
  173. 132: {
  174. slice_id: 132,
  175. slice_url: '/explore/?form_data=%7B%22slice_id%22%3A%20132%7D',
  176. slice_name: 'Life Expectancy VS Rural %',
  177. form_data: {},
  178. viz_type: VizType.LegacyBubble,
  179. datasource: '2__table',
  180. description: '',
  181. description_markdown: '',
  182. modified: '23 hours ago',
  183. changed_on: 1529453332663,
  184. changed_on_humanized: '',
  185. datasource_id: 0,
  186. datasource_type: DatasourceType.Query,
  187. datasource_url: '',
  188. datasource_name: '',
  189. owners: [{ id: 0 }],
  190. created_by: { id: 0 },
  191. thumbnail_url: '',
  192. },
  193. 133: {
  194. slice_id: 133,
  195. slice_url: '/explore/?form_data=%7B%22slice_id%22%3A%20133%7D',
  196. slice_name: 'Rural Breakdown',
  197. form_data: {},
  198. viz_type: VizType.Sunburst,
  199. datasource: '2__table',
  200. description: '',
  201. description_markdown: '',
  202. modified: '23 hours ago',
  203. changed_on: 1529453332673,
  204. changed_on_humanized: '',
  205. datasource_id: 0,
  206. datasource_type: DatasourceType.Query,
  207. datasource_url: '',
  208. datasource_name: '',
  209. owners: [{ id: 0 }],
  210. created_by: { id: 0 },
  211. thumbnail_url: '',
  212. },
  213. 134: {
  214. slice_id: 134,
  215. slice_url: '/explore/?form_data=%7B%22slice_id%22%3A%20134%7D',
  216. slice_name: "World's Pop Growth",
  217. form_data: {},
  218. viz_type: VizType.Area,
  219. datasource: '2__table',
  220. description: '',
  221. description_markdown: '',
  222. modified: '23 hours ago',
  223. changed_on: 1529453332680,
  224. changed_on_humanized: '',
  225. datasource_id: 0,
  226. datasource_type: DatasourceType.Dataset,
  227. datasource_url: '',
  228. datasource_name: '',
  229. owners: [{ id: 0 }],
  230. created_by: { id: 0 },
  231. thumbnail_url: '',
  232. },
  233. 135: {
  234. slice_id: 135,
  235. slice_url: '/explore/?form_data=%7B%22slice_id%22%3A%20135%7D',
  236. slice_name: 'Box plot',
  237. form_data: {},
  238. viz_type: VizType.BoxPlot,
  239. datasource: '2__table',
  240. description: '',
  241. description_markdown: '',
  242. modified: '23 hours ago',
  243. changed_on: 1529453332688,
  244. changed_on_humanized: '',
  245. datasource_id: 0,
  246. datasource_type: DatasourceType.Table,
  247. datasource_url: '',
  248. datasource_name: '',
  249. owners: [{ id: 0 }],
  250. created_by: { id: 0 },
  251. thumbnail_url: '',
  252. },
  253. 136: {
  254. slice_id: 136,
  255. slice_url: '/explore/?form_data=%7B%22slice_id%22%3A%20136%7D',
  256. slice_name: 'Treemap',
  257. form_data: {},
  258. viz_type: VizType.Treemap,
  259. datasource: '2__table',
  260. description: '',
  261. description_markdown: '',
  262. modified: '23 hours ago',
  263. changed_on: 1529453332700,
  264. changed_on_humanized: '',
  265. datasource_id: 0,
  266. datasource_type: DatasourceType.Table,
  267. datasource_url: '',
  268. datasource_name: '',
  269. owners: [{ id: 0 }],
  270. created_by: { id: 0 },
  271. thumbnail_url: '',
  272. },
  273. },
  274. isLoading: false,
  275. errorMessage: null,
  276. lastUpdated: 0,
  277. };