mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore(storybook): consolidate storybook and enhance plugin stories (#37771)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable no-magic-numbers, sort-keys */
|
||||
import { SuperChart } from '@superset-ui/core';
|
||||
import WorldMapChartPlugin from '@superset-ui/legacy-plugin-chart-world-map';
|
||||
import { withResizableChartDemo } from '@storybook-shared';
|
||||
import data from './data';
|
||||
|
||||
new WorldMapChartPlugin().configure({ key: 'world-map' }).register();
|
||||
|
||||
export default {
|
||||
title: 'Legacy Chart Plugins/legacy-plugin-chart-world-map',
|
||||
decorators: [withResizableChartDemo],
|
||||
args: {
|
||||
maxBubbleSize: 25,
|
||||
showBubbles: true,
|
||||
},
|
||||
argTypes: {
|
||||
maxBubbleSize: {
|
||||
control: { type: 'range', min: 5, max: 100, step: 5 },
|
||||
description: 'Maximum size of bubbles on the map',
|
||||
},
|
||||
showBubbles: { control: 'boolean' },
|
||||
},
|
||||
};
|
||||
|
||||
export const Basic = ({
|
||||
maxBubbleSize,
|
||||
showBubbles,
|
||||
width,
|
||||
height,
|
||||
}: {
|
||||
maxBubbleSize: number;
|
||||
showBubbles: boolean;
|
||||
width: number;
|
||||
height: number;
|
||||
}) => (
|
||||
<SuperChart
|
||||
chartType="world-map"
|
||||
width={width}
|
||||
height={height}
|
||||
queriesData={[{ data }]}
|
||||
formData={{
|
||||
max_bubble_size: String(maxBubbleSize),
|
||||
show_bubbles: showBubbles,
|
||||
color_picker: {},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
@@ -0,0 +1,323 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
export default [
|
||||
{
|
||||
country: 'TTO',
|
||||
m1: 91.45,
|
||||
m2: 1354483.0,
|
||||
latitude: 11,
|
||||
longitude: -61,
|
||||
name: 'Trinidad and Tobago',
|
||||
},
|
||||
{
|
||||
country: 'BDI',
|
||||
m1: 88.239,
|
||||
m2: 10816860.0,
|
||||
latitude: -3.5,
|
||||
longitude: 30,
|
||||
name: 'Burundi',
|
||||
},
|
||||
{
|
||||
country: 'PNG',
|
||||
m1: 87.015,
|
||||
m2: 7463577.0,
|
||||
latitude: -6,
|
||||
longitude: 147,
|
||||
name: 'Papua New Guinea',
|
||||
},
|
||||
{
|
||||
country: 'LIE',
|
||||
m1: 85.695,
|
||||
m2: 37286.0,
|
||||
latitude: 47.26666666,
|
||||
longitude: 9.53333333,
|
||||
name: 'Liechtenstein',
|
||||
},
|
||||
{
|
||||
country: 'UGA',
|
||||
m1: 84.234,
|
||||
m2: 37782971.0,
|
||||
latitude: 1,
|
||||
longitude: 32,
|
||||
name: 'Uganda',
|
||||
},
|
||||
{
|
||||
country: 'MWI',
|
||||
m1: 83.898,
|
||||
m2: 16695253.0,
|
||||
latitude: -13.5,
|
||||
longitude: 34,
|
||||
name: 'Malawi',
|
||||
},
|
||||
{
|
||||
country: 'NPL',
|
||||
m1: 81.757,
|
||||
m2: 28174724.0,
|
||||
latitude: 28,
|
||||
longitude: 84,
|
||||
name: 'Nepal',
|
||||
},
|
||||
{
|
||||
country: 'LKA',
|
||||
m1: 81.68,
|
||||
m2: 20639000.0,
|
||||
latitude: 7,
|
||||
longitude: 81,
|
||||
name: 'Sri Lanka',
|
||||
},
|
||||
{
|
||||
country: 'NER',
|
||||
m1: 81.531,
|
||||
m2: 19113728.0,
|
||||
latitude: 16,
|
||||
longitude: 8,
|
||||
name: 'Niger',
|
||||
},
|
||||
{
|
||||
country: 'LCA',
|
||||
m1: 81.523,
|
||||
m2: 183645.0,
|
||||
latitude: 13.88333333,
|
||||
longitude: -60.96666666,
|
||||
name: 'Saint Lucia',
|
||||
},
|
||||
{
|
||||
country: 'SSD',
|
||||
m1: 81.409,
|
||||
m2: 11911184.0,
|
||||
latitude: 7,
|
||||
longitude: 30,
|
||||
name: 'South Sudan',
|
||||
},
|
||||
{
|
||||
country: 'ETH',
|
||||
m1: 80.972,
|
||||
m2: 96958732.0,
|
||||
latitude: 8,
|
||||
longitude: 38,
|
||||
name: 'Ethiopia',
|
||||
},
|
||||
{
|
||||
country: 'WSM',
|
||||
m1: 80.74,
|
||||
m2: 191845.0,
|
||||
latitude: -13.58333333,
|
||||
longitude: -172.33333333,
|
||||
name: 'Samoa',
|
||||
},
|
||||
{
|
||||
country: 'KHM',
|
||||
m1: 79.486,
|
||||
m2: 15328136.0,
|
||||
latitude: 13,
|
||||
longitude: 105,
|
||||
name: 'Cambodia',
|
||||
},
|
||||
{
|
||||
country: 'SWZ',
|
||||
m1: 78.685,
|
||||
m2: 1269112.0,
|
||||
latitude: -26.5,
|
||||
longitude: 31.5,
|
||||
name: 'Swaziland',
|
||||
},
|
||||
{
|
||||
country: 'SLB',
|
||||
m1: 78.124,
|
||||
m2: 572171.0,
|
||||
latitude: -8,
|
||||
longitude: 159,
|
||||
name: 'Solomon Islands',
|
||||
},
|
||||
{
|
||||
country: 'ERI',
|
||||
m1: 77.807,
|
||||
m2: 5110444.0,
|
||||
latitude: 15,
|
||||
longitude: 39,
|
||||
name: 'Eritrea',
|
||||
},
|
||||
{
|
||||
country: 'TCD',
|
||||
m1: 77.659,
|
||||
m2: 13587053.0,
|
||||
latitude: 15,
|
||||
longitude: 19,
|
||||
name: 'Chad',
|
||||
},
|
||||
{
|
||||
country: 'FSM',
|
||||
m1: 77.622,
|
||||
m2: 104044.0,
|
||||
latitude: 6.91666666,
|
||||
longitude: 158.25,
|
||||
name: 'Micronesia',
|
||||
},
|
||||
{
|
||||
country: 'TON',
|
||||
m1: 76.368,
|
||||
m2: 105586.0,
|
||||
latitude: -20,
|
||||
longitude: -175,
|
||||
name: 'Tonga',
|
||||
},
|
||||
{
|
||||
country: 'SLE',
|
||||
m1: 60.422,
|
||||
m2: 6315627.0,
|
||||
latitude: 8.5,
|
||||
longitude: -11.5,
|
||||
name: 'Sierra Leone',
|
||||
},
|
||||
{
|
||||
country: 'BIH',
|
||||
m1: 60.384,
|
||||
m2: 3817554.0,
|
||||
latitude: 44,
|
||||
longitude: 18,
|
||||
name: 'Bosnia and Herzegovina',
|
||||
},
|
||||
{
|
||||
country: 'GNQ',
|
||||
m1: 60.244,
|
||||
m2: 820885.0,
|
||||
latitude: 2,
|
||||
longitude: 10,
|
||||
name: 'Equatorial Guinea',
|
||||
},
|
||||
{
|
||||
country: 'CAF',
|
||||
m1: 60.241,
|
||||
m2: 4804316.0,
|
||||
latitude: 7,
|
||||
longitude: 21,
|
||||
name: 'Central African Republic',
|
||||
},
|
||||
{
|
||||
country: 'MUS',
|
||||
m1: 60.186,
|
||||
m2: 1260934.0,
|
||||
latitude: -20.28333333,
|
||||
longitude: 57.55,
|
||||
name: 'Mauritius',
|
||||
},
|
||||
{
|
||||
country: 'ZMB',
|
||||
m1: 59.528,
|
||||
m2: 15721343.0,
|
||||
latitude: -15,
|
||||
longitude: 30,
|
||||
name: 'Zambia',
|
||||
},
|
||||
{
|
||||
country: 'FRO',
|
||||
m1: 58.257,
|
||||
m2: 48221.0,
|
||||
latitude: 62,
|
||||
longitude: -7,
|
||||
name: 'Faroe Islands',
|
||||
},
|
||||
{
|
||||
country: 'ABW',
|
||||
m1: 58.221,
|
||||
m2: 103441.0,
|
||||
latitude: 12.5,
|
||||
longitude: -69.96666666,
|
||||
name: 'Aruba',
|
||||
},
|
||||
{
|
||||
country: 'XXX',
|
||||
m1: 58.024,
|
||||
m2: 74877030.0,
|
||||
},
|
||||
{
|
||||
country: 'EGY',
|
||||
m1: 56.931,
|
||||
m2: 89579670.0,
|
||||
latitude: 27,
|
||||
longitude: 30,
|
||||
name: 'Egypt',
|
||||
},
|
||||
{
|
||||
country: 'AGO',
|
||||
m1: 56.726,
|
||||
m2: 24227524.0,
|
||||
latitude: -12.5,
|
||||
longitude: 18.5,
|
||||
name: 'Angola',
|
||||
},
|
||||
{
|
||||
country: 'SEN',
|
||||
m1: 56.607,
|
||||
m2: 14672557.0,
|
||||
latitude: 14,
|
||||
longitude: -14,
|
||||
name: 'Senegal',
|
||||
},
|
||||
{
|
||||
country: 'BEN',
|
||||
m1: 56.486,
|
||||
m2: 10598482.0,
|
||||
latitude: 9.5,
|
||||
longitude: 2.25,
|
||||
name: 'Benin',
|
||||
},
|
||||
{
|
||||
country: 'BLZ',
|
||||
m1: 55.876,
|
||||
m2: 351706.0,
|
||||
latitude: 17.25,
|
||||
longitude: -88.75,
|
||||
name: 'Belize',
|
||||
},
|
||||
{
|
||||
country: 'KIR',
|
||||
m1: 55.827,
|
||||
m2: 110470.0,
|
||||
latitude: 1.41666666,
|
||||
longitude: 173,
|
||||
name: 'Kiribati',
|
||||
},
|
||||
{
|
||||
country: 'PHL',
|
||||
m1: 55.512,
|
||||
m2: 99138690.0,
|
||||
latitude: 13,
|
||||
longitude: 122,
|
||||
name: 'Philippines',
|
||||
},
|
||||
{
|
||||
country: 'MDV',
|
||||
m1: 55.506,
|
||||
m2: 357415.0,
|
||||
latitude: 3.25,
|
||||
longitude: 73,
|
||||
name: 'Maldives',
|
||||
},
|
||||
{
|
||||
country: 'MDA',
|
||||
m1: 55.075,
|
||||
m2: 3556400.0,
|
||||
latitude: 47,
|
||||
longitude: 29,
|
||||
name: 'Moldova',
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user