// function myFunctionWithParameters(firstName, lastName) {
// return `My first name is ${firstName}, and my last name is ${lastName}.`
// }
// pass a function to map
y=x.map(x=>logistic(x))
z=x.map((x,i)=>({
x:x,
y:y[i]
}))
lineRGB=d3.scaleLinear()
.domain([minb,0,maxb])
.range(["red","purple","blue"]);
lineRGB(-0.5);// "rgb(255, 128, 128)"
lineColourx=d3.color(lineRGB(b))
lineColourx
lineColour=d3.color(lineRGB(b)).formatHex()
// color = d3.scale.linear()
// .domain([100, 0])
// .range(colorbrewer.Reds[3])
// Plot.line(z,{x: "x", y: "y", stroke: "green"})
// {
// let trace = {
// x: numHoursStudied,
// y: predictedOutcomes,
// mode: 'markers',
// type: 'scatter'
// };
// let data = [trace];
// let layout = {
// title: 'Predicted probability of passing according to the logistic model',
// xaxis: {
// title: {
// text: 'Number of hours studied',
// },
// },
// yaxis: {
// title: {
// text: 'Probability of passing the exam',
// },
// range: [0, 1]
// },
// };
// const div = htl.html`<div/>`;
// Plotly.newPlot(div, data, layout);
// return div;
// }
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.