install.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. /**
  20. * AUTO-GENERATED FILE. DO NOT MODIFY.
  21. */
  22. /*
  23. * Licensed to the Apache Software Foundation (ASF) under one
  24. * or more contributor license agreements. See the NOTICE file
  25. * distributed with this work for additional information
  26. * regarding copyright ownership. The ASF licenses this file
  27. * to you under the Apache License, Version 2.0 (the
  28. * "License"); you may not use this file except in compliance
  29. * with the License. You may obtain a copy of the License at
  30. *
  31. * http://www.apache.org/licenses/LICENSE-2.0
  32. *
  33. * Unless required by applicable law or agreed to in writing,
  34. * software distributed under the License is distributed on an
  35. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  36. * KIND, either express or implied. See the License for the
  37. * specific language governing permissions and limitations
  38. * under the License.
  39. */
  40. import brushPreprocessor from './preprocessor.js';
  41. import BrushView from './BrushView.js';
  42. import BrushModel from './BrushModel.js';
  43. import brushVisual from './visualEncoding.js'; // TODO
  44. import BrushFeature from '../toolbox/feature/Brush.js';
  45. import { registerFeature } from '../toolbox/featureManager.js';
  46. import { noop } from 'zrender/lib/core/util.js';
  47. export function install(registers) {
  48. registers.registerComponentView(BrushView);
  49. registers.registerComponentModel(BrushModel);
  50. registers.registerPreprocessor(brushPreprocessor);
  51. registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual);
  52. registers.registerAction({
  53. type: 'brush',
  54. event: 'brush',
  55. update: 'updateVisual'
  56. }, function (payload, ecModel) {
  57. ecModel.eachComponent({
  58. mainType: 'brush',
  59. query: payload
  60. }, function (brushModel) {
  61. brushModel.setAreas(payload.areas);
  62. });
  63. });
  64. /**
  65. * payload: {
  66. * brushComponents: [
  67. * {
  68. * brushId,
  69. * brushIndex,
  70. * brushName,
  71. * series: [
  72. * {
  73. * seriesId,
  74. * seriesIndex,
  75. * seriesName,
  76. * rawIndices: [21, 34, ...]
  77. * },
  78. * ...
  79. * ]
  80. * },
  81. * ...
  82. * ]
  83. * }
  84. */
  85. registers.registerAction({
  86. type: 'brushSelect',
  87. event: 'brushSelected',
  88. update: 'none'
  89. }, noop);
  90. registers.registerAction({
  91. type: 'brushEnd',
  92. event: 'brushEnd',
  93. update: 'none'
  94. }, noop);
  95. registerFeature('brush', BrushFeature);
  96. }