-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT][EXPLO][SC-46279] Table - Geo field #245
Merged
KevinFabre-ods
merged 17 commits into
main
from
feature/sc-46279/explo-sdk-table-render-mini-map-for-geo-point
Jul 5, 2024
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
af155e3
chore: make a generic map render
KevinFabre-ods 8397188
feat(Table): add geo column
KevinFabre-ods 489bca7
lint
KevinFabre-ods e0c3861
chore: update poi map class
KevinFabre-ods 7668c58
chore: update geo column prop usage
KevinFabre-ods 9040c97
chore: update map folders name
KevinFabre-ods 15ea8e9
style(Map): scope map controls to `utils/Map` component
KevinFabre-ods ae58bb2
chore: create Map folder
KevinFabre-ods f24f939
chore: add path aliases
KevinFabre-ods 136e6b5
Merge branch 'main' into feature/sc-46279/explo-sdk-table-render-mini…
KevinFabre-ods 010c1a3
feat(Table): minimap preview for geo fields
KevinFabre-ods 26bf616
test: add eslint svelte check
KevinFabre-ods e7e8a4e
chore: fix typescript
KevinFabre-ods bb45dbd
chore: remove immutable svelte option
KevinFabre-ods 5b42d5d
chore(Map): simplify popup classname usage
KevinFabre-ods 9ae11aa
Revert "chore: add path aliases"
KevinFabre-ods 2329e1b
style(Map): remove !important style
KevinFabre-ods File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions
2
...src/components/Map/WebGl/MapRender.svelte → ...ents/ChoroplethMap/WebGl/MapRender.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
<svelte:options immutable={true} /> | ||
|
||
<script lang="ts"> | ||
import maplibregl, { | ||
Map as MapType, | ||
|
4 changes: 4 additions & 0 deletions
4
packages/visualizations/src/components/ChoroplethMap/WebGl/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import 'maplibre-gl/dist/maplibre-gl.css'; | ||
|
||
export { default as ChoroplethGeoJson } from './ChoroplethGeoJson.svelte'; | ||
export { default as ChoroplethVectorTiles } from './ChoroplethVectorTiles.svelte'; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions
2
packages/visualizations/src/components/Legend/ColorsLegend.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<script lang="ts"> | ||
import CategoryLegend from '../../Legend/CategoryLegend.svelte'; | ||
import SourceLink from '../../utils/SourceLink.svelte'; | ||
import WelGlMap from '../WebGl'; | ||
|
||
import type { PoiMapProps } from './types'; | ||
import { DEFAULT_ASPECT_RATIO } from './constants'; | ||
|
||
// ensure exported type matches declared props | ||
type $$Props = PoiMapProps; | ||
|
||
export let data: $$Props['data']; | ||
export let options: $$Props['options']; | ||
|
||
// Used in front of console and error messages to debug multiple maps on a same page | ||
const mapId = Math.floor(Math.random() * 1000); | ||
|
||
$: ({ | ||
title, | ||
subtitle, | ||
description, | ||
legend, | ||
sourceLink, | ||
aspectRatio = DEFAULT_ASPECT_RATIO, | ||
} = options); | ||
|
||
$: cssVarStyles = `--aspect-ratio:${aspectRatio};`; | ||
</script> | ||
|
||
<figure class="map-card maps-container" style={cssVarStyles}> | ||
{#if title || subtitle} | ||
<figcaption> | ||
{#if title} | ||
<h3> | ||
{title} | ||
</h3> | ||
{/if} | ||
{#if subtitle} | ||
<p> | ||
{subtitle} | ||
</p> | ||
{/if} | ||
</figcaption> | ||
{/if} | ||
<div class="main" aria-describedby={description ? mapId.toString() : undefined}> | ||
{#key options.style} | ||
<WelGlMap {options} data={data.value} /> | ||
{/key} | ||
</div> | ||
{#if description} | ||
<p id={mapId.toString()} class="a11y-invisible-description">{description}</p> | ||
{/if} | ||
{#if legend} | ||
<CategoryLegend legendOptions={legend} /> | ||
{/if} | ||
{#if sourceLink} | ||
<SourceLink source={sourceLink} /> | ||
{/if} | ||
</figure> | ||
|
||
<style> | ||
.map-card { | ||
display: flex; | ||
flex-direction: column; | ||
margin: 0; | ||
position: relative; | ||
} | ||
figcaption { | ||
margin: 0 0 1em 0; | ||
} | ||
figcaption p, | ||
figcaption h3 { | ||
margin: 0; | ||
} | ||
|
||
.main { | ||
aspect-ratio: var(--aspect-ratio); | ||
flex-grow: 1; | ||
position: relative; | ||
display: block; | ||
} | ||
/* Suitable for elements that are used via aria-describedby or aria-labelledby */ | ||
.a11y-invisible-description { | ||
display: none; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export const DEFAULT_ASPECT_RATIO = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import PoiMap from './Poi.svelte'; | ||
|
||
export default PoiMap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { Async } from '../../../types'; | ||
import type { Source } from '../../types'; | ||
import type { WebGlMapData, WebGlMapOptions } from '../WebGl/types'; | ||
import type { CategoryLegend } from '../../Legend/types'; | ||
|
||
export type PoiMapData = Async<WebGlMapData>; | ||
|
||
export type PoiMapOptions = WebGlMapOptions & { | ||
title?: string; | ||
subtitle?: string; | ||
description?: string; | ||
legend?: CategoryLegend; | ||
/** Link button to source */ | ||
sourceLink?: Source; | ||
}; | ||
|
||
export type PoiMapProps = { | ||
data: PoiMapData; | ||
options: PoiMapOptions; | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this import is useless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Why ?
It is used at line 6
ods-dataviz-sdk/packages/visualizations/src/components/Map/Poi/types.ts
Line 6 in 9ae11aa