@politicalwatch/tipi-uikit 1.9.1 → 1.9.2
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/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { ref, onMounted, watch } from 'vue';
|
|
6
|
+
import { ref, toRef, onMounted, watch } from 'vue';
|
|
7
7
|
import { select } from 'd3-selection';
|
|
8
8
|
import { transition } from 'd3-transition';
|
|
9
9
|
|
|
@@ -18,6 +18,9 @@ const { selection, styles, topic } = defineProps({
|
|
|
18
18
|
topic: String,
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
+
const selectionRef = toRef(selection);
|
|
22
|
+
const topicRef = toRef(topic);
|
|
23
|
+
|
|
21
24
|
const twoCirclesRef = ref(null);
|
|
22
25
|
|
|
23
26
|
const loadVizz = () => {
|
|
@@ -31,10 +34,10 @@ const loadVizz = () => {
|
|
|
31
34
|
let maxRadius = 150;
|
|
32
35
|
let minRadius = 5;
|
|
33
36
|
|
|
34
|
-
let mainTopic =
|
|
35
|
-
let data = [
|
|
36
|
-
let maxName =
|
|
37
|
-
let maxNumber =
|
|
37
|
+
let mainTopic = topicRef.value;
|
|
38
|
+
let data = [selectionRef.value.selected];
|
|
39
|
+
let maxName = selectionRef.value.compareswith._id;
|
|
40
|
+
let maxNumber = selectionRef.value.compareswith.initiatives;
|
|
38
41
|
let mainColor = styles.topics[mainTopic] ? styles.topics[mainTopic].color : styles.defaultColor;
|
|
39
42
|
let maxColor = styles.topics[maxName] ? styles.topics[maxName].color : mainColor;
|
|
40
43
|
|
|
@@ -115,7 +118,7 @@ onMounted(() => {
|
|
|
115
118
|
loadVizz();
|
|
116
119
|
});
|
|
117
120
|
|
|
118
|
-
watch(
|
|
121
|
+
watch(selectionRef.value.selected._id, () => {
|
|
119
122
|
loadVizz();
|
|
120
123
|
});
|
|
121
124
|
</script>
|