Skip to content

Commit

Permalink
bug: add sample ID to point, closes #41
Browse files Browse the repository at this point in the history
berntpopp committed Dec 3, 2023
1 parent 4c0e941 commit b13ee21
Showing 2 changed files with 26 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -476,6 +476,7 @@ export default {
chart.data.datasets[0].data.push({
x: newData.age,
y: normalizedTLV.value,
id: newData.id // Include the ID
});
chart.update();
@@ -616,9 +617,23 @@ export default {
},
tooltip: {
callbacks: {
beforeBody: (context) => {
const id = context[0].raw.id;
return id ? `ID: ${id}` : '';
label: function(context) {
let label = context.dataset.label || '';
if (label) {
label += ': ';
}
if (context.parsed.x !== null) {
label +=context.parsed.x;
}
if (context.parsed.y !== null) {
label += ', ' + context.parsed.y.toFixed(2);
}
// Append the ID to the tooltip
const dataPoint = context.raw;
if (dataPoint && dataPoint.id) {
label += `; ID: ${dataPoint.id}`;
}
return label;
}
}
}
8 changes: 8 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -2,4 +2,12 @@ const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
publicPath: process.env.NODE_ENV === "production" ? "/pld-progression-grouper/" : "/",
pwa: {
name: 'PLD-Progression Grouper',
short_name: 'PLD-PG',
start_url: './',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'black',
themeColor: '#00bf7d',
}
})

0 comments on commit b13ee21

Please sign in to comment.