enso/app/gui2/stories/GeoMapVisualization.story.vue
somebody1234 f2651d58e4
[gui2] Component demos (#7945)
- Closes #7916

# Important Notes
None
2023-10-29 19:02:07 +00:00

58 lines
1.3 KiB
Vue

<script setup lang="ts">
import GraphVisualization from '@/components/GraphEditor/GraphVisualization.vue'
import { Vec2 } from '@/util/vec2'
import type { VisualizationIdentifier } from 'shared/yjsModel'
import { ref } from 'vue'
const isCircularMenuVisible = ref(false)
const data = ref<any>({
latitude: 37.8,
longitude: -122.45,
zoom: 15,
controller: true,
showingLabels: true, // Enables presenting labels when hovering over a point.
layers: [
{
type: 'Scatterplot_Layer',
data: [
{
latitude: 37.8,
longitude: -122.45,
color: [255, 0, 0],
radius: 100,
label: 'an example label',
},
],
},
],
})
const nodeSize = ref(new Vec2(400, 32))
const currentType: VisualizationIdentifier = {
module: { kind: 'Builtin' },
name: 'Geo Map',
}
</script>
<template>
<Story
title="Geo Map"
group="visualizations"
:layout="{ type: 'grid', width: 400 }"
autoPropsDisabled
>
<GraphVisualization
:currentType="currentType"
:data="data"
:nodeSize="nodeSize"
:isCircularMenuVisible="isCircularMenuVisible"
/>
<template #controls>
<HstCheckbox v-model="isCircularMenuVisible" title="circular menu visible" />
<HstJson v-model="data" title="data" />
</template>
</Story>
</template>