diff --git a/gui/src/components/chat.vue b/gui/src/components/chat.vue index dfbd9e69..f8b974ed 100644 --- a/gui/src/components/chat.vue +++ b/gui/src/components/chat.vue @@ -2,6 +2,124 @@ import chat_conversations from "./chat_conversations.vue"; import chat_messages from "./chat_messages.vue"; import chat_new_message from "./chat_new_message.vue"; + + + + + + +import { setActivePinia } from "pinia"; +import pinia from "../store/index"; +setActivePinia(pinia); + +import { useChatStore } from "../store/chatStore.js"; +const chat = useChatStore(pinia); + + + + + + + + + +import { + Chart as ChartJS, + CategoryScale, + LinearScale, + PointElement, + Title, + Tooltip, + Legend, + BarElement, +} from "chart.js"; + +import { Bar } from "vue-chartjs"; +import { ref, computed } from "vue"; +import annotationPlugin from "chartjs-plugin-annotation"; + + +ChartJS.register( + CategoryScale, + LinearScale, + PointElement, + Title, + Tooltip, + Legend, + BarElement, + annotationPlugin, +); + +var beaconHistogramOptions = { + type: "bar", + bezierCurve: false, //remove curves from your plot + scaleShowLabels: false, //remove labels + tooltipEvents: [], //remove trigger from tooltips so they will'nt be show + pointDot: false, //remove the points markers + scaleShowGridLines: true, //set to false to remove the grids background + maintainAspectRatio: true, + plugins: { + legend: { + display: false, + }, + annotation: { + annotations: [ + { + type: "line", + mode: "horizontal", + scaleID: "y", + value: 0, + borderColor: "darkgrey", // Set the color to dark grey for the zero line + borderWidth: 0.5, // Set the line width + }, + ], + }, + }, + + scales: { + x: { + position: "bottom", + display: false, + min: -10, + max: 15, + ticks: { + display: false, + }, + }, + y: { + display: false, + min: -5, + max: 10, + ticks: { + display: false, + }, + }, + }, +}; + +const beaconHistogramData = computed(() => ({ + labels: chat.beaconLabelArray, + datasets: [ + { + data: chat.beaconDataArray, + tension: 0.1, + borderColor: "rgb(0, 255, 0)", + + backgroundColor: function (context) { + var value = context.dataset.data[context.dataIndex]; + return value >= 0 ? "green" : "red"; + }, + }, + ], +})); + + + + + + + +