forked from MapComplete/MapComplete
Refactoring: port ChartJS to Svelte
This commit is contained in:
parent
ca4f7566e2
commit
1d48d935ba
7 changed files with 333 additions and 339 deletions
|
|
@ -10,11 +10,11 @@
|
|||
import Tr from "../Base/Tr.svelte"
|
||||
import AccordionSingle from "../Flowbite/AccordionSingle.svelte"
|
||||
import Translations from "../i18n/Translations"
|
||||
import TagRenderingChart from "../BigComponents/TagRenderingChart"
|
||||
import ToSvelte from "../Base/ToSvelte.svelte"
|
||||
import type { TagRenderingConfigJson } from "../../Models/ThemeConfig/Json/TagRenderingConfigJson"
|
||||
import { Or } from "../../Logic/Tags/Or"
|
||||
import { Utils } from "../../Utils"
|
||||
import ChartJs from "../Base/ChartJs.svelte"
|
||||
import { ChartJsUtils } from "../Base/ChartJsUtils"
|
||||
|
||||
export let onlyShowUsername: string[]
|
||||
export let features: Feature[]
|
||||
|
|
@ -138,13 +138,13 @@
|
|||
</ul>
|
||||
{#if diff.tr}
|
||||
<div class="h-48 w-48">
|
||||
<ToSvelte
|
||||
construct={new TagRenderingChart(diff.features, diff.tr, {
|
||||
<ChartJs config={ChartJsUtils.createConfigForTagRendering(
|
||||
diff.tr, diff.features,{
|
||||
groupToOtherCutoff: 0,
|
||||
chartType: "pie",
|
||||
sort: true,
|
||||
})}
|
||||
/>
|
||||
}
|
||||
)} />
|
||||
</div>
|
||||
{:else}
|
||||
Could not create a graph - this item type has no associated question
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue