aframe-babia-components 1.3.3 → 1.3.4
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/components/visualizers/babia-boats.js +24 -16
- package/dist/aframe-babia-components.js +8 -6
- package/dist/aframe-babia-components.min.js +1 -1
- package/dist/aframe-babia-components.min.js.map +1 -1
- package/docs/APIs/CHARTS.md +1 -2
- package/docs/RELEASE_NOTES.md +5 -0
- package/examples/boats/boats2/data.json +34 -2
- package/examples/boats/boats2/index.html +1 -1
- package/package.json +1 -1
|
@@ -2008,22 +2008,30 @@ let generateLegend = (data, {
|
|
|
2008
2008
|
const vcolor = safe(data?.[fcolor]);
|
|
2009
2009
|
|
|
2010
2010
|
// Texto final
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2011
|
+
let processedTemplate = isQuarter ? '{name}' : template;
|
|
2012
|
+
|
|
2013
|
+
processedTemplate = processedTemplate
|
|
2014
|
+
.replaceAll('{name}', name)
|
|
2015
|
+
.replaceAll('{height}', vheight)
|
|
2016
|
+
.replaceAll('{area}', varea)
|
|
2017
|
+
.replaceAll('{width}', vwidth)
|
|
2018
|
+
.replaceAll('{depth}', vdepth)
|
|
2019
|
+
.replaceAll('{color}', vcolor)
|
|
2020
|
+
.replaceAll('{fheight}', fheight)
|
|
2021
|
+
.replaceAll('{farea}', farea)
|
|
2022
|
+
.replaceAll('{fwidth}', fwidth)
|
|
2023
|
+
.replaceAll('{fdepth}', fdepth)
|
|
2024
|
+
.replaceAll('{fcolor}', fcolor);
|
|
2025
|
+
|
|
2026
|
+
const knownPlaceholders = new Set([
|
|
2027
|
+
'name', 'height', 'area', 'width', 'depth', 'color',
|
|
2028
|
+
'fheight', 'farea', 'fwidth', 'fdepth', 'fcolor'
|
|
2029
|
+
]);
|
|
2030
|
+
|
|
2031
|
+
const finalText = processedTemplate.replace(/\{(\w+)\}/g, (match, variable) => {
|
|
2032
|
+
if (knownPlaceholders.has(variable)) return match; // ya procesado
|
|
2033
|
+
return safe(data?.[variable], match); // si existe en rawData, lo usamos
|
|
2034
|
+
});
|
|
2027
2035
|
|
|
2028
2036
|
const lines = finalText.split('\n');
|
|
2029
2037
|
const width = Math.max(...lines.map(line => line.length)) / 5;
|