Published
Edited
Mar 15, 2021
Insert cell
md`# OpenTox: Toxicology Softwares`
Insert cell
md`Select from the categories below. Press Ctrl to select multiple choices.`
Insert cell
viewof selected_Online_Softwares = Select(unique_Online_softwares, {label: "Select Online Software", multiple: true, value: unique_Online_softwares})
Insert cell
viewof selected_Type_of_Software = Select(unique_Type_of_Software, {label: "Select Type of Software", multiple: true, value: default_Type_of_Software})
Insert cell
viewof selected_Prediction_Rate = Select(unique_Prediction_Rate, {label: "Select Prediction rate", multiple: true, value: default_Prediction_Rate})
Insert cell
Table(filtered_datasets)
Insert cell
vl.markBar()
.data(dataset)
.encode(
vl.y().count(),
vl.x().fieldN("Type of Software"),
vl.tooltip(["Prediction Rate", "Data type", "Type of Software", "Online softwares"])
)
.width(600).height(400).render()
Insert cell
vl.markBar()
.data(dataset)
.encode(
vl.y().count(),
vl.x().fieldN("Online softwares"),
vl.tooltip(["Prediction Rate", "Data type", "Type of Software", "Online softwares"])
)
.width(600).height(400).render()
Insert cell
filtered_datasets = dataset
.filter(item => selected_Online_Softwares.includes(item["Online softwares"]))
.filter(item => selected_Type_of_Software.includes(item["Type of Software"]))
.filter(item => selected_Prediction_Rate.includes(item["Prediction Rate"]))
Insert cell
default_Prediction_Rate = [unique_Prediction_Rate[0]]
Insert cell
unique_Prediction_Rate = get_unique_elements(dataset, "Prediction Rate")
Insert cell
default_Type_of_Software = unique_Type_of_Software
Insert cell
unique_Type_of_Software = get_unique_elements(dataset, "Type of Software")
Insert cell
default_Online_softwares = unique_Online_softwares
Insert cell
unique_Online_softwares = get_unique_elements(dataset, "Online softwares")
Insert cell
function get_unique_elements(array, property_name) {
var set = new Set(array.map(x => x[property_name]));
return Array.from(set).filter(function(item) {return item != null;}).sort()
}
Insert cell
dataset = fetch_dataset_to_array(dataset_url, {})
Insert cell
function fetch_dataset_to_array(dataset_url, query_options) {
return fetch(dataset_url, query_options).then(response_dataset => {
if (!response_dataset.ok) throw new Error(response_dataset.status);
return response_dataset.json();}).then(json => json.results.map(x => x.data));
}
Insert cell
dataset_url = base_url_edelweiss + dataset_id + "/versions/latest/data"
Insert cell
base_url_edelweiss = 'https://api.edelweissdata.com/datasets/'
Insert cell
dataset_id = "9f64a112-153b-4047-ba27-9a8711e0ef65"
Insert cell
import {Select, Range, Toggle, Table} from "@observablehq/inputs"
Insert cell
import { vl } from "@vega/vega-lite-api"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more