legendContinuousSize.js 837 B

12345678910111213141516171819
  1. import { scaleOf } from './utils';
  2. import { LegendContinuous } from './legendContinuous';
  3. export const LegendContinuousSize = (options) => {
  4. return (context) => {
  5. const { scales } = context;
  6. const sizeScale = scaleOf(scales, 'size');
  7. return LegendContinuous(Object.assign({}, {
  8. type: 'size',
  9. tick: false,
  10. data: sizeScale.getOptions().domain.map((value, index) => ({
  11. value,
  12. label: String(value),
  13. })),
  14. labelFilter: (datum, index, data) => index === 0 || index === data.length - 1,
  15. }, options))(context);
  16. };
  17. };
  18. LegendContinuousSize.props = Object.assign(Object.assign({}, LegendContinuous.props), { defaultPosition: 'top', defaultOrientation: 'horizontal' });
  19. //# sourceMappingURL=legendContinuousSize.js.map