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

Jsvis prototype #12

Merged
merged 34 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
95b77b7
WIP jsvis interface prototype
francoismg Apr 15, 2024
78a0fbd
WIP jsvis interface prototype
francoismg Apr 22, 2024
eba6113
Fix filename
dsavchenko Apr 22, 2024
afdcbdf
Merge pull request #14 from esg-epfl-apc/main
francoismg Apr 23, 2024
035f543
WIP jsvis interface prototype
francoismg Apr 23, 2024
20e9c7d
WIP jsvis interface prototype (graphs bug fixes, error bars, file upl…
francoismg Apr 29, 2024
790f942
demo file relative path
dsavchenko May 3, 2024
3e7bf82
WIP jsvis interface prototype
francoismg May 3, 2024
11bb88f
proper file path
dsavchenko May 3, 2024
e38c83d
path
dsavchenko May 3, 2024
0241846
WIP jsvis interface prototype
francoismg May 8, 2024
e83afd0
Merge branch 'jsvis-prototype' of https://github.com/esg-epfl-apc/ast…
francoismg May 8, 2024
52816a0
WIP jsvis interface prototype
francoismg May 10, 2024
6d8605c
WIP D3 custom range
francoismg May 22, 2024
5eb6a90
WIP Bokeh custom range + fixes
francoismg May 24, 2024
e577e92
WIP workaround acr file + partial clean up
francoismg May 24, 2024
a5b2108
WIP visjs plugin
francoismg May 31, 2024
c83480b
WIP D* drawing out of bound bug fix
francoismg May 31, 2024
2e503fa
WIP refactor build
francoismg Jun 7, 2024
5560144
WIP cherrypick single axis error bar D3 + Bokeh + fixes and wip
francoismg Jul 18, 2024
a2cbf5f
WIP custom columns
francoismg Aug 6, 2024
688348a
Refactoring for package creation
francoismg Sep 19, 2024
db8d1bb
Fix bugs with arithmetic columns + arithmetic columns now usable in e…
francoismg Sep 27, 2024
a5ccf3d
npm package version change + prod build
francoismg Sep 27, 2024
5231e8c
Fixed arithmetic column axis bug in Bokeh
francoismg Sep 27, 2024
9eabaf6
Arbitrary numbers in arithmetic columns
francoismg Oct 2, 2024
06035d5
cleanup
francoismg Oct 2, 2024
444163f
fix for deleted arithmetic columns in dropdown
francoismg Oct 2, 2024
42b9d3d
Prod build + version change
francoismg Oct 2, 2024
57134b2
Prod build + version change + galaxy display fix + sticky graph + set…
francoismg Oct 15, 2024
481cffd
fix visual glitch galaxy
francoismg Oct 16, 2024
ba9dc0d
fix for file detail toggle bug
francoismg Oct 16, 2024
1d1ec9c
fixes for user specified companion files related bugs
francoismg Oct 25, 2024
dc342c5
support for blob url + version bumb and prod build
francoismg Nov 29, 2024
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
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
"description": "",
"version": "0.0.1",
"config": {
"prototype": "test"
"prototype": "jsvis"
},
"scripts": {
"build-preview": "mkdir -p preview; cp -r prototypes/${npm_package_config_prototype}/* preview/."
"build-preview": "mkdir -p preview; cp -r prototypes/${npm_package_config_prototype}/* preview/."
},
"dependencies": {
"bootstrap": "^5.3.3",
"css-loader": "^7.1.2",
"style-loader": "^4.0.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ function createGraph(fits_file, settings) {
let scales = null;

if(settings) {
console.log("Axis");
console.log(settings['select-axis-x']);
console.log(settings['select-axis-y']);

console.log("Error bars");
console.log(settings['select-axis-x-error-bars']);
console.log(settings['select-axis-y-error-bars']);

console.log(settings['select-axis-x']);
console.log(settings['select-axis-y']);

let x_column = settings['select-axis-x'].value;
let y_column = settings['select-axis-y'].value;
Expand Down
102 changes: 12 additions & 90 deletions prototypes/jsvis/d3Wrapper.js → prototypes/jsvis/_old/d3Wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@ let margin = {top: 10, right: 30, bottom: 30, left: 60},
width = 800 - margin.left - margin.right,
height = 400 - margin.top - margin.bottom;

function createGraph0(container, data, settings = null) {
function instantiateGraph(container, data, settings = null) {

}

function createGraphLightCurve(data, settings) {

console.log(data);
console.log(settings);
}

function createGraphSpectrum(data, settings) {

}

function createGraph0(container, data, settings = null) {

dataset = data;
settings_data = settings;
Expand Down Expand Up @@ -56,15 +65,6 @@ function createGraph0(container, data, settings = null) {

if(settings) {

console.log("Axis settings");

console.log("Axis")
console.log(settings['select-axis-x-scale']);
console.log(settings['select-axis-y-scale']);

console.log(settings['select-axis-x']);
console.log(settings['select-axis-y']);

let x_scale = settings['select-axis-x-scale'].value;
let y_scale = settings['select-axis-y-scale'].value;

Expand All @@ -74,10 +74,6 @@ function createGraph0(container, data, settings = null) {
}

try {
console.log("Error bars")
console.log(settings['select-axis-x-error-bars']);
console.log(settings['select-axis-y-error-bars']);

let error_bar_x_column = settings['select-axis-x-error-bars'].value;
let error_bar_y_column = settings['select-axis-y-error-bars'].value;
} catch(e) {
Expand Down Expand Up @@ -167,10 +163,8 @@ function createGraph0(container, data, settings = null) {
let y_data = 'RATE';

if(settings) {
console.log('settings');
x_data = settings['select-axis-x'].value;
y_data = settings['select-axis-y'].value;
console.log(x_data + ' ' + y_data);
} else {
x_data = 'TIME';
y_data = 'RATE';
Expand Down Expand Up @@ -224,15 +218,9 @@ function createAxis(data, settings, _svg, width, height, scales) {
"log": d3.scaleLog
};

console.log(settings['select-axis-x']);
console.log(settings['select-axis-y']);

let x_axis_col = settings['select-axis-x'].value;
let y_axis_col = settings['select-axis-y'].value;

console.log("Axis columns");
console.log(x_axis_col+" "+y_axis_col);

let _x = scale_functions[scales.x]()
.domain(d3.extent(data, d => d[x_axis_col]))
.range([ 0, width ]);
Expand Down Expand Up @@ -280,8 +268,6 @@ function createAxis(data, settings, _svg, width, height, scales) {

function updateChart(e) {

console.log(e);

let newX = e.transform.rescaleX(x);
let newY = e.transform.rescaleY(y);

Expand Down Expand Up @@ -323,10 +309,8 @@ function updateChart(e) {
let y_data;

if(settings_data) {
console.log('settings data');
x_data = settings_data['select-axis-x'].value;
y_data = settings_data['select-axis-y'].value;
console.log(x_data + ' ' + y_data);
} else {
x_data = 'TIME';
y_data = 'RATE';
Expand Down Expand Up @@ -375,65 +359,3 @@ function updateChart(e) {
})
*/
}

function createGraph1(container, data) {

const margin = {top: 50, right: 30, bottom: 30, left: 60},
width = 460,
height = 450;

let svg = d3.select(container)
.append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform",
"translate(" + margin.left + "," + margin.top + ")");

let x = d3.scaleLinear()
.domain(d3.extent(data, d => d.time))
.range([ 0, width ]);

let xAxis = svg.append("g")
.attr("id", "x_demo")
.attr("transform", "translate(0," + height + ")")
.call(d3.axisBottom(x)
.tickFormat(d3.format(".1f")))
.call(g => g.selectAll(".tick line").clone()
.attr("class", "tick-line")
.attr("y2", -height)
.attr("stroke-opacity", 0.2))

let y = d3.scaleLinear()
.domain(d3.extent(data, d => d.rate))
.range([ height, 0]);

let ylog = d3.scaleLog()
.domain([1, d3.max(data, d => d.rate)])
.range([ height, 0]);

let yAxis = svg.append("g")
.attr("id", "y_demo")
.call(d3.axisLeft(y)
.tickFormat(d3.format(".1f")))
.call(g => g.selectAll(".tick line").clone()
.attr("x2", width)
.attr("stroke-opacity", 0.2));

yAxis.select(".tick:last-of-type text").clone()
.attr("id", "y-label")
.attr("x", 3)
.attr("y", -5)
.attr("text-anchor", "start")
.attr("font-weight", "bold")
.text("Rate");

xAxis.select(".tick:last-of-type text").clone()
.attr("id", "y-label")
.attr("y", -11)
.attr("x", 2)
.attr("text-anchor", "start")
.attr("font-weight", "bold")
.text("Time");

}
Loading
Loading