Skip to content

Commit

Permalink
Règler problèmes graphiques
Browse files Browse the repository at this point in the history
  • Loading branch information
julienmalard committed Mar 21, 2024
1 parent 10e0503 commit e00a2d0
Show file tree
Hide file tree
Showing 17 changed files with 229 additions and 19 deletions.
12 changes: 0 additions & 12 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,16 @@ export {}

declare module 'vue' {
export interface GlobalComponents {
Accueil: (typeof import("./src/components/étapes/Accueil.vue"))["default"]
'AjoutDonnée': typeof import('./src/components/étapes/démo/AjoutDonnée.vue')['default']
BtnMenuLangues: typeof import('./src/components/BtnMenuLangues.vue')['default']
'CarteFonctionalité': (typeof import("./src/components/CarteFonctionalité.vue"))["default"]
CarteLien: typeof import('./src/components/étapes/communs/CarteLien.vue')['default']
CarteOption: (typeof import("./src/components/étapes/communs/CarteOption.vue"))["default"]
'CarteTéléchargement': (typeof import("./src/components/CarteTéléchargement.vue"))["default"]
CarteUtilisation: (typeof import("./src/components/CarteUtilisation.vue"))["default"]
copy: (typeof import("./src/components/MenuLangues copy.vue"))["default"]
'ÉtapeCours': typeof import('./src/components/ÉtapeCours.vue')['default']
GraphiqueStation: typeof import('./src/components/étapes/démo/GraphiqueStation.vue')['default']
IndiceInstallationApple: (typeof import("./src/components/IndiceInstallationApple.vue"))["default"]
InfoStation: (typeof import("./src/components/étapes/démo/InfoStation.vue"))["default"]
'ItemLangueProgrès': typeof import('./src/components/ItemLangueProgrès.vue')['default']
MarqueurSite: (typeof import("./src/components/étapes/démo/MarqueurSite.vue"))["default"]
MarqueurStation: typeof import('./src/components/étapes/démo/MarqueurStation.vue')['default']
MenuLangues: typeof import('./src/components/MenuLangues.vue')['default']
'MesDonnées': typeof import('./src/components/étapes/démo/MesDonnées.vue')['default']
OptionObtConstellation: (typeof import("./src/components/étapes/obtConstellation/OptionObtConstellation.vue"))["default"]
PageAccueil: (typeof import("./src/components/étapes/PageAccueil.vue"))["default"]
PagePrincipale: typeof import('./src/components/PagePrincipale.vue')['default']
'PageTéléchargements': (typeof import("./src/components/PageTéléchargements.vue"))["default"]
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
SectionAccueil: typeof import('./src/components/étapes/SectionAccueil.vue')['default']
Expand Down
17 changes: 12 additions & 5 deletions src/components/étapes/démo/GraphiqueStation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ const donnéesCumul = computed(()=>{
listeJours.forEach((j) => {
const obsPourCeJour = données.value.filter(d=>mêmeJour(d.date, j));
console.log({obsPourCeJour})
if (obsPourCeJour.length) {
for (const obs of obsPourCeJour) {
cumul.push({
Expand All @@ -105,8 +106,8 @@ const donnéesCumul = computed(()=>{
})
}
}
);
console.log({cumul})
return cumul;
})
Expand Down Expand Up @@ -155,7 +156,7 @@ onMounted(() => {
);
// https://d3-graph-gallery.com/graph/barplot_animation_start.html
svg.selectAll<SVGSVGElement, unknown>("bar")
svg.selectAll<SVGSVGElement, unknown>(".bar")
.data(données.value)
.join("rect")
// everything after .join() is applied to every "new" and "existing" element
Expand All @@ -167,11 +168,17 @@ onMounted(() => {
.attr("fill", "steelblue")
// Animation
svg.selectAll<SVGSVGElement, unknown>("rect")
svg.selectAll<SVGSVGElement, unknown>("bar")
.transition()
.duration(800)
.attr("y", function(d) { return y(d.précip); })
.attr("height", function(d) { return height - y(d.précip); })
.attr("y", function(d) { return y((d as {
date: Date;
précip: number;
}).précip); })
.attr("height", function(d) { return height - y((d as {
date: Date;
précip: number;
}).précip); })
.delay((d,i) => i*100)
// render axes with help of scales
Expand Down
17 changes: 15 additions & 2 deletions src/components/étapes/démo/SectionDémo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@
false-icon="mdi-cloud-off-outline"
:color="précipSurCarte ? 'primary' : undefined"
/>
<v-menu>
<template #activator="{props: propsActivateur}">
<v-btn v-bind="propsActivateur" icon="mdi-cog" variant="flat"></v-btn>
</template>
<v-list>
<v-list-item class="text-color-error" title="Clear my data" @click="()=>effacerDonnées()">
<template #prepend>
<v-icon icon="mdi-delete" />
</template>
</v-list-item>
</v-list>
</v-menu>
</div>
<v-card-text class="px-0">
<v-row v-if="stationSélectionnée">
Expand Down Expand Up @@ -177,8 +189,9 @@ const { மொழியாக்கம்_பயன்படுத்து } =
const { $மொ: t } = மொழியாக்கம்_பயன்படுத்து();
const { எண்ணை_வடிவூட்டு } = எண்களைப்_பயன்படுத்து();
const { choisirObservationAléatoire, exporterDonnées, contribuer } =
utiliserDonnées();
const {
choisirObservationAléatoire, exporterDonnées, contribuer, effacerDonnées
} = utiliserDonnées();
// Contrôles
const précipSurCarte = ref(false);
Expand Down
13 changes: 13 additions & 0 deletions src/composables/données.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,18 @@ export const utiliserDonnées = () => {
});
};

const effacerDonnées = async () => {
const données = mesContributions.value;
if (données)
await Promise.all(données.map(d=>constl.bds.effacerÉlémentDeTableauUnique({
schémaBd: SCHÉMA_DONNÉES,
idNuéeUnique: ID_NUÉE_DONNÉES,
clefTableau: CLEF_TABLEAU,
idÉlément: d.id
}))
)
}

return {
toutesPhotos: données,
numérisées,
Expand All @@ -226,5 +238,6 @@ export const utiliserDonnées = () => {
mesContributions,
exporterDonnées,
bdsCorresp,
effacerDonnées,
};
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions src/données/népal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ import img98cab885 from "./images/98cab885-01af-4ed7-b809-43554204ad8e.jpg";
import imgca767251 from "./images/ca767251-3b63-4c11-ba48-06f3c28e641d.jpg";
import img4dc830d7 from "./images/4dc830d7-ed49-4297-b585-ee040e69987c.jpg";
import img8f1a194b from "./images/8f1a194b-4858-4379-99b8-aee921cb9857.jpg";
import img125dced1 from "./images/125dced1-9367-4f36-9380-cc971a2e6765.jpg";
import img6a64c7fa from "./images/6a64c7fa-ab8f-4432-8bd5-bb1ffddfd211.jpg";
import img8b51cf44 from "./images/8b51cf44-9062-4a12-998a-60efd8d4ea63.jpg";
import imgd9f0d0d0 from "./images/d9f0d0d0-82aa-4bd1-91f5-6db508dab992.jpg";
import imgacd44583 from "./images/acd44583-6881-4a41-afc0-ebcbebf961f4.jpg";
import imgd2b938eb from "./images/d2b938eb-d695-4e14-9ee2-dde1cea47e82.jpg";
import img918d2d6f from "./images/918d2d6f-dc5a-4d1b-9dd5-2de96cc56ac6.jpg";
import img1f756bda from "./images/1f756bda-953a-4051-be5b-a71bc2396d32.jpg";
import imgc3ee6e26 from "./images/c3ee6e26-d5a6-428d-94df-6f6434c2ac26.jpg";
import img9948d540 from "./images/9948d540-759c-43af-8564-9cc3eac65542.jpg";
import imgc6656497 from "./images/c6656497-915d-47e8-a3c1-527dd62e5c66.jpg";

export type InfoStation = { id: string; coords: [number, number] };
export const stations: InfoStation[] = [
{
Expand All @@ -85,6 +97,10 @@ export const stations: InfoStation[] = [
id: "PT01071_2886",
coords: [27.6349734, 85.5276167],
},
{
id: "PT00924_2627",
coords: [27.6717534, 85.3249833],
}
];

export type InfoObservation = {
Expand Down Expand Up @@ -557,4 +573,70 @@ export const données: InfoObservation[] = [
horo: "2023-08-08T10:37:08.398Z",
image: img8f1a194b,
},
{
id: "125dced1-9367-4f36-9380-cc971a2e6765",
station: "PT00924_2627",
horo: "2023-06-28T11:46:27.024Z",
image: img125dced1,
},
{
id: "6a64c7fa-ab8f-4432-8bd5-bb1ffddfd211",
station: "PT00924_2627",
horo: "2023-08-15T02:45:29.529Z",
image: img6a64c7fa,
},
{
id: "8b51cf44-9062-4a12-998a-60efd8d4ea63",
station: "PT00924_2627",
horo: "2023-05-05T03:17:58.429Z",
image: img8b51cf44,
},
{
id: "d9f0d0d0-82aa-4bd1-91f5-6db508dab992",
station: "PT00924_2627",
horo: "2023-05-27T06:12:14.237Z",
image: imgd9f0d0d0,
},
{
id: "acd44583-6881-4a41-afc0-ebcbebf961f4",
station: "PT00924_2627",
horo: "2023-05-18T05:00:30.683Z",
image: imgacd44583,
},
{
id: "d2b938eb-d695-4e14-9ee2-dde1cea47e82",
station: "PT00924_2627",
horo: "2023-06-25T12:18:03.692Z",
image: imgd2b938eb,
},
{
id: "918d2d6f-dc5a-4d1b-9dd5-2de96cc56ac6",
station: "PT00924_2627",
horo: "2023-07-02T05:26:45.11Z",
image: img918d2d6f,
},
{
id: "1f756bda-953a-4051-be5b-a71bc2396d32",
station: "PT00924_2627",
horo: "2023-06-16T11:53:00.382Z",
image: img1f756bda,
},
{
id: "c3ee6e26-d5a6-428d-94df-6f6434c2ac26",
station: "PT00924_2627",
horo: "2023-06-20T06:17:53Z",
image: imgc3ee6e26,
},
{
id: "9948d540-759c-43af-8564-9cc3eac65542",
station: "PT00924_2627",
horo: "2023-06-14T08:08:32.894Z",
image: img9948d540,
},
{
id: "c6656497-915d-47e8-a3c1-527dd62e5c66",
station: "PT00924_2627",
horo: "2023-05-15T13:10:30.802Z",
image: imgc6656497,
},
];
Loading

0 comments on commit e00a2d0

Please sign in to comment.