Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D3 bypass observable - stats corrected #808

Draft
wants to merge 57 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
53685d0
Changes to intro page - embedded from observable
Giaccomole Dec 18, 2024
427fe21
Prettier website and enabled iframe in config
Giaccomole Dec 18, 2024
529d89c
New line + Signed-off-by test
Giaccomole Jan 13, 2025
5b700d2
Second Signoff test
Giaccomole Jan 13, 2025
b934e68
Third Signoff test
Giaccomole Jan 13, 2025
145921d
Image was changed
Giaccomole Jan 13, 2025
9d3d00a
Image paths corrected
Giaccomole Jan 13, 2025
47f12d9
Observable abandoned for 3 plots
Giaccomole Jan 20, 2025
ad8d88f
Merge branch 'COVESA:master' into D3-Bypass-Observable
Giaccomole Jan 20, 2025
aef5082
Merge branch 'D3-Bypass-Observable' of https://github.com/Giaccomole/…
Giaccomole Jan 20, 2025
358db19
Added newlines to html
Giaccomole Jan 20, 2025
568f135
Added newlines to html
Giaccomole Jan 20, 2025
03621e5
Added newlines at the ends of the data files
Giaccomole Jan 20, 2025
77e702b
Ran pre-commit
Giaccomole Jan 20, 2025
95f0fa7
Merge branch 'COVESA:master' into D3-Bypass-Observable
Giaccomole Feb 5, 2025
bddb3c2
faulty stats corrected
Giaccomole Feb 5, 2025
14e322c
automated pie chart to map ver dynamically, tidied name convention
Giaccomole Feb 5, 2025
ace30a4
Action test
Giaccomole Feb 12, 2025
21d9bd5
action step
Giaccomole Feb 12, 2025
c35e744
action steps
Giaccomole Feb 12, 2025
4bfb728
Action to save files
Giaccomole Feb 12, 2025
de18665
Update generated data files
github-actions[bot] Feb 12, 2025
7590c24
Actions test from top
Giaccomole Feb 12, 2025
d33ced8
Update generated data files
github-actions[bot] Feb 12, 2025
26ad7f6
recursive changes test
Giaccomole Feb 12, 2025
69437d4
recursive changes test
Giaccomole Feb 12, 2025
e212fe6
Doc Update (#792)
erikbosch Dec 3, 2024
fe1f7c6
Changes to intro page - embedded from observable
Giaccomole Dec 18, 2024
f30b9c9
Prettier website and enabled iframe in config
Giaccomole Dec 18, 2024
1959879
New line + Signed-off-by test
Giaccomole Jan 13, 2025
7ddcf77
Second Signoff test
Giaccomole Jan 13, 2025
489ac30
Third Signoff test
Giaccomole Jan 13, 2025
f841b9f
Image was changed
Giaccomole Jan 13, 2025
d0c4387
Image paths corrected
Giaccomole Jan 13, 2025
ce74064
Observable abandoned for 3 plots
Giaccomole Jan 20, 2025
c4c754d
Pr780 (#793)
erikbosch Dec 10, 2024
bfafa4a
Fix 24.04 build
erikbosch Dec 10, 2024
6b95323
Added newlines to html
Giaccomole Jan 20, 2025
b9fed7a
Added newlines to html
Giaccomole Jan 20, 2025
b5e1130
Added newlines at the ends of the data files
Giaccomole Jan 20, 2025
156eeb7
Ran pre-commit
Giaccomole Jan 20, 2025
7d1604e
Clarify VSS expectations on read/write (#796)
erikbosch Jan 29, 2025
f690be5
refactor: Unique names for the pattern {parent_banch_name}.{branch_name}
jdacoello Dec 17, 2024
b2205d7
Update pre-commit version
erikbosch Jan 23, 2025
76b009a
faulty stats corrected
Giaccomole Feb 5, 2025
f51b50c
automated pie chart to map ver dynamically, tidied name convention
Giaccomole Feb 5, 2025
4f6d79e
Action test
Giaccomole Feb 12, 2025
d76e28e
action step
Giaccomole Feb 12, 2025
bc1b08a
action steps
Giaccomole Feb 12, 2025
940452d
Action to save files
Giaccomole Feb 12, 2025
ce84729
Update generated data files
github-actions[bot] Feb 12, 2025
42823f3
Actions test from top
Giaccomole Feb 12, 2025
661d586
Update generated data files
github-actions[bot] Feb 12, 2025
b915b23
recursive changes test
Giaccomole Feb 12, 2025
61bdfcf
recursive changes test
Giaccomole Feb 12, 2025
0eb3d7c
Merge branch 'D3-Bypass-Observable' of https://github.com/Giaccomole/…
Giaccomole Feb 12, 2025
974ad11
Merge branch 'COVESA:master' into D3-Bypass-Observable
Giaccomole Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/docgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@ jobs:
with:
submodules: true

- name: Clone vss-tools-statistics-py-scripts repository
run: |
git clone -b stat-scripts https://github.com/Giaccomole/vss-tools-statistics-py-scripts
cd vss-tools-statistics-py-scripts
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync
uv run vspec stats piechart -s ../spec/VehicleSignalSpecification.vspec -o ../docs-gen/static/data/piechart.csv
uv run vspec stats sankey -s ../spec/VehicleSignalSpecification.vspec -o ../docs-gen/static/data/sankey.csv
uv run vspec stats radial -s ../spec/VehicleSignalSpecification.vspec -o ../docs-gen/static/data/radial.json
cd ..

- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add docs-gen/static/data/piechart.csv docs-gen/static/data/sankey.csv docs-gen/static/data/radial.json
git diff-index --quiet HEAD || git commit -m "Update generated data files"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install hugo
env:
HUGO_VER : 0.129.0
Expand Down
1 change: 1 addition & 0 deletions arbitrary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
something to test
Empty file added docs-gen/.hugo_build.lock
Empty file.
6 changes: 3 additions & 3 deletions docs-gen/content/introduction/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ chapter: false
The diagram below shows a generated tree of the VSS. Here you can see a mapping for the current catalog of signals related to vehicles. Click a Branch Node to expand or collapse the tree. (Slower animation while pressing the altKey ("option" key for Mac OS-X).)


{{< radialcluster >}}
{{< radial >}}

---
## Current Population of the model - in respect to VSS Types and Datatypes


Click on the nodes to highlight the links, or hover over the links to see their exact population.

{{< parallelsets >}}
{{< sankey >}}

---
## Releases and types

How the model changed in major releases.

{{< donut_chart >}}
{{< piechart >}}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="chart-container" style="height: 550px; ">
<div id="chart-container" style="height: 550px;">
<div id="dataset-selector" style="margin-bottom: 20px;"></div>
<div id="donut"></div>
</div>
Expand All @@ -9,7 +9,7 @@
console.log("Plot.js script loaded");

console.log("Attempting to load CSV data from /data");
d3.csv("/vehicle_signal_specification/data/piechartnotexpanded.csv").then(data => {
d3.csv("/vehicle_signal_specification/data/piechart.csv").then(data => {
console.log("CSV Data loaded successfully:", data);

const width = 800; // Assuming a fixed width for the chart
Expand All @@ -22,7 +22,6 @@
"Branches": "#26547C", // Blue for nodes with children
"Actuators": "#EF476F", // Red for actuators
"Sensors": "#FFD166", // Yellow for sensors

};

const svg = d3.create("svg")
Expand All @@ -43,7 +42,7 @@
// Update chart function
function updateChart(dataset) {
console.log(`Updating chart with dataset: ${dataset}`);
const dataTransformed = data.map(d => ({ type: d.Type, value: d[dataset] }));
const dataTransformed = data.map(d => ({ type: d.Type, value: +d[dataset] }));
const pieData = pie(dataTransformed);

const totalValue = d3.sum(dataTransformed, d => d.value);
Expand Down Expand Up @@ -110,59 +109,60 @@
return t => arc(i(t));
}

// Initialize the chart with the default dataset "V5"
console.log("Initializing chart with dataset: V5");
updateChart("V5");
// Create dataset selector based on the CSV headers
console.log("Creating dataset selector");
const selectorContainer = document.getElementById("dataset-selector");
const datasetKeys = Object.keys(data[0]).slice(1); // Get dataset keys excluding the 'Type' column

// Determine the latest version to initialize the chart with
const latestVersion = datasetKeys[datasetKeys.length - 1];
console.log(`Initializing chart with dataset: ${latestVersion}`);
updateChart(latestVersion);

console.log("Appending plot to #donut");
document.getElementById("donut").appendChild(svg.node());
console.log("Plot appended successfully");

// Create dataset selector
console.log("Creating dataset selector");
const selectorContainer = document.getElementById("dataset-selector");
const datasets = new Map([["V2.0", "V2"], ["V3.0", "V3"], ["V4.0", "V4"], ["V5.0", "V5"]]);

const radioForm = document.createElement("form");
radioForm.style.display = "inline-block"; // Ensure form is inline-block for center alignment

// Add a label before the radio buttons
const formLabel = document.createElement("span");
formLabel.textContent = "Release: ";
formLabel.style.fontWeight = "500";
formLabel.style.marginTop = "20px";
formLabel.style.marginRight = "10px";
radioForm.appendChild(formLabel);

datasets.forEach((value, key) => {
const label = document.createElement("label");
label.style.marginLeft = "15px"; // Add space between options
label.style.fontWeight = "500"; // Semibold text style
label.style.display = "inline-block"; // Ensure radio buttons are aligned horizontally

const input = document.createElement("input");
input.type = "radio";
input.name = "dataset";
input.value = value;

if (value === "V5") input.checked = true; // Default selection
input.addEventListener("change", () => {
console.log(`Dataset changed to: ${value}`);
updateChart(value); // Trigger chart change based on the selected value
});

label.appendChild(input);
label.appendChild(document.createTextNode(key));

radioForm.appendChild(label);
});

selectorContainer.appendChild(radioForm);
console.log("Dataset selector created successfully");
const radioForm = document.createElement("form");
radioForm.style.display = "inline-block"; // Ensure form is inline-block for center alignment

// Add a label before the radio buttons
const formLabel = document.createElement("span");
formLabel.textContent = "Release: ";
formLabel.style.fontWeight = "500";
formLabel.style.marginTop = "20px";
formLabel.style.marginRight = "10px";
radioForm.appendChild(formLabel);

datasetKeys.forEach(key => {
const label = document.createElement("label");
label.style.marginLeft = "15px"; // Add space between options
label.style.fontWeight = "500"; // Semibold text style
label.style.display = "inline-block"; // Ensure radio buttons are aligned horizontally

const input = document.createElement("input");
input.type = "radio";
input.name = "dataset";
input.value = key;

if (key === latestVersion) input.checked = true; // Default selection
input.addEventListener("change", () => {
console.log(`Dataset changed to: ${key}`);
updateChart(key); // Trigger chart change based on the selected value
});

label.appendChild(input);
label.appendChild(document.createTextNode(key));

radioForm.appendChild(label);
});

selectorContainer.appendChild(radioForm);
console.log("Dataset selector created successfully");
}).catch(error => {
console.error("Error loading CSV data:", error);
document.getElementById("donut").innerText = "Error loading data. Please check the console for details.";
});

console.log("Script execution complete");
</script>
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as d3 from "https://cdn.jsdelivr.net/npm/d3@7/+esm";

async function createChart() {
const data = await d3.json("/vehicle_signal_specification/data/outputplus.json");
const data = await d3.json("/vehicle_signal_specification/data/radial.json");

const width = 800; // Adjust the width as needed
const radius = width / 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,6 @@
return { nodes, links };
}

const dataUrl = "/vehicle_signal_specification/data/modified_vss_compact_metadata copy.csv";
const dataUrl = "/vehicle_signal_specification/data/sankey.csv";
csv(dataUrl).then(data => drawChart(data));
</script>
Loading
Loading