formData.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. /* eslint sort-keys: 'off' */
  20. /** The form data defined here is based on default visualizations packaged with Apache Superset */
  21. import { TimeGranularity, VizType } from '@superset-ui/core';
  22. export const bigNumberFormData = {
  23. datasource: '3__table',
  24. viz_type: VizType.BigNumber,
  25. slice_id: 54,
  26. granularity_sqla: 'ds',
  27. time_grain_sqla: TimeGranularity.DAY,
  28. time_range: '100 years ago : now',
  29. metric: 'sum__num',
  30. adhoc_filters: [],
  31. compare_lag: '5',
  32. compare_suffix: 'over 5Y',
  33. y_axis_format: '.3s',
  34. show_trend_line: true,
  35. start_y_axis_at_zero: true,
  36. };
  37. export const wordCloudFormData = {
  38. datasource: '3__table',
  39. viz_type: VizType.WordCloud,
  40. slice_id: 60,
  41. url_params: {},
  42. granularity_sqla: 'ds',
  43. time_grain_sqla: 'P1D',
  44. time_range: '100 years ago : now',
  45. series: 'name',
  46. metric: 'sum__num',
  47. adhoc_filters: [],
  48. row_limit: 50,
  49. size_from: 10,
  50. size_to: 70,
  51. rotation: 'square',
  52. };
  53. export const sunburstFormData = {
  54. datasource: '2__table',
  55. viz_type: VizType.Sunburst,
  56. slice_id: 47,
  57. url_params: {},
  58. granularity_sqla: 'year',
  59. time_grain_sqla: 'P1D',
  60. time_range: '2011-01-01 : 2011-01-01',
  61. columns: ['region', 'country_name'],
  62. metric: 'sum__SP_POP_TOTL',
  63. secondary_metric: 'sum__SP_RUR_TOTL',
  64. adhoc_filters: [],
  65. row_limit: 10000,
  66. };
  67. export const sankeyFormData = {
  68. datasource: '1__table',
  69. viz_type: VizType.Sankey,
  70. slice_id: 1,
  71. url_params: {},
  72. granularity_sqla: null,
  73. time_grain_sqla: 'P1D',
  74. time_range: 'Last week',
  75. groupby: ['source', 'target'],
  76. metric: 'sum__value',
  77. adhoc_filters: [],
  78. row_limit: 1000,
  79. };