Public
Edited
Feb 17, 2024
Importers
5 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
smith = props => {
const $ = React.createElement;
const SC = smithChart.chart($);
const root = document.createElement('div');
const r = (props && props.r) || 256;
const dark = document.body.classList.contains("observablehq--dark");
const tree = $('div', {},
$('svg', {width: 2 * r + 3, height: 2 * r + 3},
$('defs', {},
$('style', {}, `
.plot0 { fill: none; stroke: #0af; stroke-width: 2; stroke-linejoin: round; }
.plot1 { fill: none; stroke: #f50; stroke-width: 2; stroke-linejoin: round; }
.plot2 { fill: none; stroke: #3a3; stroke-width: 2; stroke-linejoin: round; }
.plot3 { fill: none; stroke: #a3a; stroke-width: 2; stroke-linejoin: round; }
.l1 { stroke: ${dark ? '#fff' : '#000'}; fill: none; stroke-linecap: round; }
.l2 { stroke: ${dark ? '#777' : '#aaa'}; fill: none; stroke-linecap: round; }`
)
),
$('g', {transform: `translate(${2 * r + 1}, ${r + 1})`},
$(SC.Grid.Re, {r: r, lines: SC.grid}),
$(SC.Grid.Im, {r: r, lines: SC.grid}),
$('g', {transform: `translate(${-r})`},
props.data.map((dat, i) =>
$('path', {
className: 'plot' + i,
d: 'M' + dat.map(e => {
const G = circleCircleIntersect(reactanceCircle(e[2]), resistanceCircle(e[1]))
return [r * G[0], -r * G[1]];
}).join(' ')
})
)),
$(SC.ReLabels, { r: r, lines: SC.reLabels0 })
)
)
);
ReactDOM.render(tree, root);
return root;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
RL = async url => {
const a = await fetch(url);
const b = await a.text();
const c = b.split('\n');
c.shift();
const d = c.map(e => e.split(','));
const f = d.map(e => [Number(e[0]), e[3]/50, e[5]/50])
return f;
}
Insert cell
Insert cell
helix2_1270_RL = await RL('https://gist.githubusercontent.com/drom/d3321fcf2bbbba5e14b858ca87ca606f/raw/ae03287213b77a40cabac4128452a2af59057386/VNA_180518_183330.csv')
Insert cell
helix2_915_RL = await RL('https://gist.githubusercontent.com/drom/2761177f0ea1d644e32d9d56a29ab0e4/raw/547c515a478dd4cd53cd10f750003d1c036bba62/VNA_180518_154659.csv')
Insert cell
helix3_1270_RL = await RL('https://gist.githubusercontent.com/drom/315829050608099a90bb3ea3f8846cee/raw/19fbb9881ddd0952861867161af1f5ffdc921115/VNA_180529_000255.csv')
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more