@tekkare/romulus 0.1.249 → 0.1.251
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/components/BarChart.vue +1 -0
- package/dist/runtime/components/ChoroplethMap.vue +4 -1
- package/dist/runtime/components/Notes.vue +40 -2
- package/dist/runtime/internal/geo/fr-regions.json +1 -1
- package/dist/runtime/utils/chart.d.ts +6 -3
- package/dist/runtime/utils/chart.js +15 -2
- package/layer/app/components/panels/OipPanelNotes.vue +4 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -12,6 +12,7 @@ const props = withDefaults(defineProps<{
|
|
|
12
12
|
/** Categories de l'axe : annees, libelles d'indicateur. */
|
|
13
13
|
categories: (string | number)[]
|
|
14
14
|
series: RmSeriesInput[]
|
|
15
|
+
/** Barres couchees, la premiere categorie en haut, comme dans un classement. */
|
|
15
16
|
horizontal?: boolean
|
|
16
17
|
height?: keyof typeof RM_CHART_HEIGHTS | number
|
|
17
18
|
description?: string
|
|
@@ -133,10 +133,13 @@ const ramp = computed(() => {
|
|
|
133
133
|
return props.reverseColors ? [...seq].reverse() : seq
|
|
134
134
|
})
|
|
135
135
|
|
|
136
|
+
// Les noms sont compares en NFC des deux cotes : un meme « ô » s'ecrit en un
|
|
137
|
+
// caractere ou en « o » suivi d'un accent combinant, et la region restait
|
|
138
|
+
// grise quand l'app et le trace ne l'ecrivaient pas pareil.
|
|
136
139
|
const byName = computed(() => {
|
|
137
140
|
const out = new Map<string, number | null>()
|
|
138
141
|
for (const entry of props.data) {
|
|
139
|
-
out.set(entry.name, entry.value === null || entry.value === undefined ? null : Number(entry.value))
|
|
142
|
+
out.set(entry.name.normalize('NFC'), entry.value === null || entry.value === undefined ? null : Number(entry.value))
|
|
140
143
|
}
|
|
141
144
|
return out
|
|
142
145
|
})
|
|
@@ -17,9 +17,16 @@
|
|
|
17
17
|
main : une note qu'on rallonge annoncerait sinon une duree fausse. La date,
|
|
18
18
|
elle, vient de l'appelant — c'est une date de revision editoriale, que rien
|
|
19
19
|
dans le contenu ne permet de deviner.
|
|
20
|
+
|
|
21
|
+
`openId` sert au lecteur qui arrive par un renvoi (le « i » d'un filtre) :
|
|
22
|
+
la note qu'il est venu chercher s'ouvre depliee et defile en vue, au lieu
|
|
23
|
+
d'une liste repliee ou il devrait la retrouver. La recherche et la pastille
|
|
24
|
+
sont remises a zero, sinon la note pourrait etre filtree hors de la liste.
|
|
25
|
+
Le depliage n'a lieu qu'une fois par identifiant : un rechargement des notes
|
|
26
|
+
ne rouvre pas une note que le lecteur vient de replier.
|
|
20
27
|
-->
|
|
21
28
|
<script setup lang="ts">
|
|
22
|
-
import { computed, ref } from 'vue'
|
|
29
|
+
import { computed, nextTick, ref, watch } from 'vue'
|
|
23
30
|
|
|
24
31
|
export type RmNoteTone = 'primary' | 'info' | 'warning' | 'success' | 'neutral'
|
|
25
32
|
|
|
@@ -90,6 +97,11 @@ const props = withDefaults(defineProps<{
|
|
|
90
97
|
*/
|
|
91
98
|
editable?: boolean
|
|
92
99
|
lang?: 'fr' | 'en'
|
|
100
|
+
/**
|
|
101
|
+
* Note a ouvrir depliee et a montrer. Attendue meme si les notes arrivent
|
|
102
|
+
* apres (chargement distant) : elle s'ouvre des qu'elle est dans la liste.
|
|
103
|
+
*/
|
|
104
|
+
openId?: string | null
|
|
93
105
|
}>(), {
|
|
94
106
|
categories: () => [],
|
|
95
107
|
title: 'Notes',
|
|
@@ -97,6 +109,7 @@ const props = withDefaults(defineProps<{
|
|
|
97
109
|
badge: undefined,
|
|
98
110
|
editable: false,
|
|
99
111
|
lang: 'fr',
|
|
112
|
+
openId: null,
|
|
100
113
|
})
|
|
101
114
|
|
|
102
115
|
const emit = defineEmits<{ navigate: [to: string], edit: [id: string] }>()
|
|
@@ -136,6 +149,30 @@ const search = ref('')
|
|
|
136
149
|
const category = ref('all')
|
|
137
150
|
const open = ref<string[]>([])
|
|
138
151
|
|
|
152
|
+
const root = ref<HTMLElement | null>(null)
|
|
153
|
+
let revealed: string | null = null
|
|
154
|
+
|
|
155
|
+
watch(
|
|
156
|
+
() => [props.openId, props.notes] as const,
|
|
157
|
+
([id]) => {
|
|
158
|
+
if (!id) {
|
|
159
|
+
revealed = null
|
|
160
|
+
return
|
|
161
|
+
}
|
|
162
|
+
if (id === revealed || !props.notes.some(note => note.id === id)) return
|
|
163
|
+
revealed = id
|
|
164
|
+
search.value = ''
|
|
165
|
+
category.value = 'all'
|
|
166
|
+
if (!open.value.includes(id)) open.value = [...open.value, id]
|
|
167
|
+
nextTick(() => {
|
|
168
|
+
root.value
|
|
169
|
+
?.querySelector(`[data-note-id="${CSS.escape(id)}"]`)
|
|
170
|
+
?.scrollIntoView({ block: 'start' })
|
|
171
|
+
})
|
|
172
|
+
},
|
|
173
|
+
{ immediate: true },
|
|
174
|
+
)
|
|
175
|
+
|
|
139
176
|
function toggle(id: string) {
|
|
140
177
|
open.value = open.value.includes(id)
|
|
141
178
|
? open.value.filter(item => item !== id)
|
|
@@ -237,7 +274,7 @@ function onLink(to: string) {
|
|
|
237
274
|
</script>
|
|
238
275
|
|
|
239
276
|
<template>
|
|
240
|
-
<div class="rm-notes">
|
|
277
|
+
<div ref="root" class="rm-notes">
|
|
241
278
|
<div class="rm-notes__head">
|
|
242
279
|
<h2 v-if="title" class="rm-notes__title">{{ title }}</h2>
|
|
243
280
|
<span v-if="badge" class="rm-notes__badge">
|
|
@@ -290,6 +327,7 @@ function onLink(to: string) {
|
|
|
290
327
|
<article
|
|
291
328
|
v-for="note in shown"
|
|
292
329
|
:key="note.id"
|
|
330
|
+
:data-note-id="note.id"
|
|
293
331
|
class="rm-notes__note"
|
|
294
332
|
:class="{ 'rm-notes__note--open': open.includes(note.id) }"
|
|
295
333
|
>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"Auvergne-
|
|
2
|
+
"Auvergne-Rhône-Alpes": {
|
|
3
3
|
"path": "M1594.02 905.625L1592.46 900.11L1587.06 899.714L1587.64 896.318L1581.84 894.741L1581.35 884.209L1579.37 882.144L1581.8 874.258L1578.2 872.067L1572.78 872.447L1561.24 861.188L1562.65 844.212L1575.52 842.67L1581.44 838.84L1582.11 834.563L1586.54 830.972L1585.84 826.218L1582.86 823.834L1584.5 822.596L1575.11 809.523L1570.15 812.68L1568.32 811.301L1571.03 800.142L1560.23 798.149L1560.96 788.003L1567.44 776.23L1557.43 764.763L1561.16 761.018L1562.7 753.713L1547.99 749.472L1530.59 749.102L1502.15 764.039L1498.72 771.46L1501.65 772.752L1500.55 776.782L1503.01 780.764L1508.21 780.042L1506.7 784.792L1499.96 787.756L1488.89 797.902L1480.74 796.045L1479.07 798.637L1474.54 797.134L1470.66 799.636L1474.62 791.488L1471.42 789.171L1473.07 786.084L1488.46 780.797L1486.08 775.552L1493.31 762.945L1482.08 755.362L1461.26 778.642L1445.88 779.241L1444.65 771.796L1437.48 769.503L1437.09 766.346L1432.06 773.857L1428.87 774.088L1426 778.056L1419.05 778.701L1417.26 777.147L1418.29 769.549L1415.13 770.841L1413.77 765.837L1411.6 771.596L1411.5 767.27L1407.06 762.39L1408.75 760.54L1400.44 755.793L1403.08 753.435L1402.09 750.674L1393.71 748.883L1390.12 741.056L1386.49 739.451L1386.36 741.783L1383.03 741.072L1374.64 744.856L1366.9 740.114L1363.32 742.277L1362.39 739.51L1345.1 792.238L1339.33 791.671L1340.34 786.695L1338.64 784.376L1340.43 783.484L1334.4 779.549L1337.72 776.52L1334.44 772.29L1329.9 773.073L1327.87 778.534L1324.16 777.949L1322.55 774.165L1319.37 777.751L1315.68 778.211L1310.85 773.659L1305.19 773.872L1303.29 786.569L1300.55 788.688L1301.67 790.761L1296.88 790.885L1291.91 795.182L1288.57 794.951L1289.06 790.499L1286.02 792.002L1284.09 789.439L1280.94 792.601L1276.11 792.079L1272.91 788.778L1265.07 793.292L1260.82 793.307L1259.04 788.177L1250.26 786.379L1252.29 781.447L1250.34 775.495L1255.99 773.127L1256.23 769.88L1260.6 770.941L1262.44 768.986L1260.32 768.77L1259.4 758.033L1261.91 748.269L1256.92 745.847L1256.62 743.468L1247.99 744.224L1244.78 737.535L1241.2 739.482L1234.44 736.422L1233.84 726.602L1231.39 725.567L1232.28 722.749L1229.69 717.794L1223.35 710.324L1221.91 702.911L1218.05 701.84L1216.67 703.794L1218.92 707.624L1213.65 707.874L1215.06 713.114L1213.44 714.742L1211.82 713.006L1207.12 718.798L1203.97 718.922L1203.51 712.973L1200.1 709.238L1195.68 709.422L1192.24 713.887L1188.67 713.034L1187.31 708.927L1183.96 708.77L1176.56 715.063L1169 707.157L1161.44 703.481L1158.6 696.697L1151.38 695.238L1146.82 697.008L1139.23 704.334L1138.87 707.419L1133.78 706.024L1129.77 708.783L1126.84 704.069L1124.94 704.395L1123.43 708.521L1115.19 712.924L1115.58 717.82L1113.14 715.852L1109.41 717.789L1112.16 720.841L1109.02 725.577L1112.99 727.774L1114.16 734.144L1105.82 739.443L1100.53 737.357L1087.09 739.816L1083.08 746.934L1080.43 746.949L1078.52 754.755L1079.27 760.658L1084.24 762.076L1080.86 766.543L1087.55 771.593L1089.98 768.347L1093.59 775.793L1094.67 773.792L1100.08 776.238L1104.73 790.499L1108.99 795.395L1107.32 806.022L1109.61 811.966L1112.82 813.849L1111.9 820.554L1113.87 823.492L1108.86 825.832L1106.72 829.562L1108.02 832.403L1101.99 836.541L1101.18 839.991L1097.81 839.534L1097.33 839.642L1094.54 844.479L1091.58 843.852L1090.08 845.881L1095.94 855.989L1100.37 857.559L1104.5 863.436L1104.29 873.78L1100.49 873.993L1097.84 880.788L1100.83 886.133L1103.86 887.15L1100.64 907.634L1104.97 911.736L1099.87 915.08L1089.87 908.769L1085.79 908.738L1087.94 912.463L1087 920.13L1082.34 922.414L1079.46 927.446L1077.33 927.007L1074.29 933.442L1069.3 937.546L1070.04 943.624L1073.39 946.021L1067.77 950.303L1067.06 958.587L1063.87 957.94L1059.13 961.929L1063.86 970.727L1060.31 973.688L1059.43 973.462L1055.17 974.559L1056.82 980.776L1059.6 982.861L1057.68 985.368L1058.34 989.9L1066.92 1002.59L1062.44 1016.36L1065.57 1016.49L1066.93 1025.28L1070.78 1028.26L1072.6 1027.28L1071.58 1023.44L1080.09 1020.57L1083.47 1020.27L1086.2 1024.74L1100.23 1023.21L1101.9 1017.5L1108.37 1012.85L1107.28 1007.87L1112.67 1002.08L1113.12 994.033L1127.24 979.692L1131.23 984.076L1131.05 992.53L1134.46 989.74L1140.29 989.756L1143.35 1002.51L1146.78 1001.85L1148.56 1004.79L1145.83 1006.69L1148.34 1009.25L1148.52 1018.87L1153.31 1024.17L1157.1 1013.84L1159.42 1013.53L1158.08 1011.63L1160.17 1000.88L1162.98 995.248L1165.81 995.846L1166.29 991.032H1166.9L1166.27 987.989L1169.27 985.363L1175.7 991.528L1180.43 987.75L1179.07 984.508L1181.86 983.442L1181.03 980.575L1183.71 979.525L1185.72 981.883L1194.82 974.629L1194.88 976.912L1199.53 979.63L1199.71 986.175L1207.12 999.936L1209.2 997.269L1216.06 995.53L1218.03 997.015L1218.56 989.566L1225.01 989.535L1227.2 992.802L1226.36 996.609L1234.55 995.217L1241.6 1006.23L1244.25 1004.44L1244.4 1008.74L1248.65 1009.88L1247.09 1014.2L1249.55 1016.37L1248 1019.12L1251.06 1024.08L1251.59 1031.66L1254.37 1035.39L1256.88 1035.17L1260.68 1049.85L1269.29 1059.79L1266.25 1061.88L1268.11 1066L1265.83 1070.99L1267.06 1072.63L1275.78 1070.01L1277.16 1073.49L1280.96 1072.77L1289.36 1080.64L1292.71 1076.59L1292.62 1073.21L1296.73 1069.76L1303.74 1068.54L1304.12 1076.86L1308.63 1077.92L1310.25 1069.73L1315.81 1068.94L1316.52 1071.18L1320.44 1071.67L1321.48 1075.1L1331.16 1079.81L1331.29 1070.98L1346.01 1073.46L1349.25 1086.19L1355.74 1081.24L1360.26 1081.39L1374.94 1074.29L1376.7 1077.81L1380.12 1078.76L1384.65 1074.01L1386.35 1073.2L1384.8 1085.52L1393.06 1088.61L1395.13 1085.64L1400.35 1089.24L1406.44 1088.17L1409.6 1090.25L1409.41 1096.94L1415 1097.45L1417.09 1102.27L1422.25 1102.8L1426.31 1100.3L1430.72 1096.61L1428.75 1094.65L1429.84 1092.31L1432.73 1091.6L1436.76 1095.08L1435.86 1097.64L1440.91 1098.25L1441.35 1095.72L1437.84 1094.1L1438.06 1091.88L1441.76 1090.87L1441.78 1080.37H1437.57L1436.45 1075.37L1433.39 1074.54L1435.66 1070.48L1426.97 1070.96L1424.15 1067.91L1421.15 1069.86L1414.45 1064.34L1415.82 1061.91L1413.25 1056.86L1415.3 1055.66L1419.4 1057.73L1421.64 1055.08L1418.06 1053.52L1417.36 1045.86L1434 1049.99L1435.55 1045.73L1439.32 1045.4L1432.19 1039.2L1437.62 1029.08L1437.1 1023.13L1446.28 1025.04L1448.44 1021.6L1452.72 1022.89L1457.09 1017.36L1453.73 1014.97L1456.73 1007.02L1462.67 1008.96L1469.96 1006.87L1473.07 1003.71L1469.79 1000.22L1477.06 995.61L1481.2 998.546L1489.46 991.307L1501.56 993.167L1506.26 989.869L1511.03 993.737L1513.11 992.718L1513.38 980.038L1509.59 977.86L1509.71 971.115L1502 971.461L1496.97 968.5L1498.62 961.233L1501.23 960.3L1499.76 955.589L1501.36 952.774L1503.24 951.87L1506.52 954.641L1510.72 952.365L1514.01 955.468L1514.07 960.344L1523.26 963.082L1527.06 962.615L1526.39 956.909L1529.6 954.441L1532.94 955.887L1536.81 952.257L1542.43 954.487L1547.67 949.876L1554.28 950.254L1557.01 947.015L1565.67 951.895L1570.38 950.449L1570.4 945.671L1576 945.461L1581.98 937.844L1590.55 938.358L1596.23 932.427L1593.57 921.625L1599.22 916.603L1600.48 909.188L1594.02 905.625Z",
|
|
4
4
|
"departments": [
|
|
5
5
|
"Ain",
|
|
@@ -418,15 +418,18 @@ export declare function rmBarHorizontalOption(labels: string[], values: (number
|
|
|
418
418
|
type: string;
|
|
419
419
|
};
|
|
420
420
|
yAxis: {
|
|
421
|
-
|
|
422
|
-
show: boolean;
|
|
423
|
-
};
|
|
421
|
+
inverse: boolean;
|
|
424
422
|
axisLabel: {
|
|
423
|
+
width: number;
|
|
424
|
+
overflow: string;
|
|
425
425
|
formatter?: ((value: number) => string) | undefined;
|
|
426
426
|
fontSize: number;
|
|
427
427
|
color: string;
|
|
428
428
|
fontFamily: string;
|
|
429
429
|
};
|
|
430
|
+
splitLine: {
|
|
431
|
+
show: boolean;
|
|
432
|
+
};
|
|
430
433
|
axisLine: {
|
|
431
434
|
lineStyle: {
|
|
432
435
|
color: string;
|
|
@@ -193,9 +193,22 @@ export function rmBarHorizontalOption(labels, values, theme, palette, decal = fa
|
|
|
193
193
|
return {
|
|
194
194
|
...rmBaseOption(theme, decal),
|
|
195
195
|
tooltip: { ...rmBaseOption(theme, decal).tooltip, ...rmTooltipValue(valueFormatter) },
|
|
196
|
-
|
|
196
|
+
// `containLabel` reserve deja la place des libelles : une marge gauche
|
|
197
|
+
// fixe s'y ajoutait, et un libelle long ecrasait le trace au point de
|
|
198
|
+
// faire se chevaucher les graduations de l'axe des valeurs.
|
|
199
|
+
grid: { left: 8, right: 60, top: 16, bottom: 24, containLabel: true },
|
|
197
200
|
xAxis: { type: "value", ...axisCommon(theme, valueFormatter) },
|
|
198
|
-
yAxis: {
|
|
201
|
+
yAxis: {
|
|
202
|
+
type: "category",
|
|
203
|
+
data: labels,
|
|
204
|
+
...axisCommon(theme),
|
|
205
|
+
// ECharts empile les categories de bas en haut : la premiere valeur se
|
|
206
|
+
// lisait en bas, a l'inverse d'un classement ou d'un tableau.
|
|
207
|
+
inverse: true,
|
|
208
|
+
// Au-dela, le libelle est coupe ; l'infobulle le donne en entier.
|
|
209
|
+
axisLabel: { ...axisCommon(theme).axisLabel, width: 180, overflow: "truncate" },
|
|
210
|
+
splitLine: { show: false }
|
|
211
|
+
},
|
|
199
212
|
series: [{
|
|
200
213
|
type: "bar",
|
|
201
214
|
data: values,
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
badge="Tekkare"
|
|
30
30
|
:lang="locale === 'en' ? 'en' : 'fr'"
|
|
31
31
|
:editable="superAdmin"
|
|
32
|
+
:open-id="openId"
|
|
32
33
|
@navigate="go"
|
|
33
34
|
@edit="openEditor"
|
|
34
35
|
/>
|
|
@@ -60,8 +61,10 @@ const props = withDefaults(
|
|
|
60
61
|
showOrigin?: boolean;
|
|
61
62
|
/** Notes encore ecrites dans le code de l'app (cf. useOipNotes). */
|
|
62
63
|
localNotes?: Note[];
|
|
64
|
+
/** Note a ouvrir depliee : le « i » d'un filtre renvoie a sa note. */
|
|
65
|
+
openId?: string | null;
|
|
63
66
|
}>(),
|
|
64
|
-
{ sourceUuids: () => [], superAdmin: false, showOrigin: undefined, localNotes: () => [] },
|
|
67
|
+
{ openId: null, sourceUuids: () => [], superAdmin: false, showOrigin: undefined, localNotes: () => [] },
|
|
65
68
|
);
|
|
66
69
|
|
|
67
70
|
const { locale } = useI18n();
|