index.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * <<
  3. * Davinci
  4. * ==
  5. * Copyright (C) 2016 - 2017 EDP
  6. * ==
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. * >>
  19. */
  20. import line from './line'
  21. import bar from './bar'
  22. import scatter from './scatter'
  23. import pie from './pie'
  24. import area from './area'
  25. import funnel from './funnel'
  26. import map from './map'
  27. import radar from './radar'
  28. import sankey from './sankey'
  29. import parallel from './parallel'
  30. import wordCloud from './wordCloud'
  31. import waterfall from './waterfall'
  32. import doubleYAxis from './doubleYAxis'
  33. import gauge from './gauge'
  34. import { EChartOption } from 'echarts'
  35. import { IChartProps } from '../../components/Chart'
  36. export default function (type, chartProps: IChartProps, drillOptions?: any): EChartOption {
  37. switch (type) {
  38. case 'line': return line(chartProps, drillOptions)
  39. // @ts-ignore
  40. case 'bar': return bar(chartProps, drillOptions)
  41. // @ts-ignore
  42. case 'scatter': return scatter(chartProps, drillOptions)
  43. case 'pie': return pie(chartProps, drillOptions)
  44. case 'funnel': return funnel(chartProps, drillOptions)
  45. // case 'area': return area(chartProps)
  46. case 'radar': return radar(chartProps)
  47. case 'sankey': return sankey(chartProps)
  48. case 'parallel': return parallel(chartProps)
  49. case 'map': return map(chartProps)
  50. case 'wordCloud': return wordCloud(chartProps)
  51. case 'waterfall': return waterfall(chartProps)
  52. case 'doubleYAxis': return doubleYAxis(chartProps, drillOptions)
  53. case 'gauge': return gauge(chartProps, drillOptions)
  54. }
  55. }