Platform
Resources
Pricing
Sign in
Get started
ssk
Into telecom, standardization, R&D, spectrum, 3gpp, 5G, and obsessive for programming
Workspace
Fork
Public
By
ssk
Edited
Sep 29, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
kav
=
function
(
d
)
{
if
(
d
%
4
==
0
)
return
true
;
else
return
false
}
Insert cell
c
(
a
(
)
,
b
(
)
)
Insert cell
x
=
new
Set
(
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
]
)
Insert cell
d3
=
require
(
"d3@6"
)
Insert cell
result
=
d3
.
filter
(
x
,
kav
)
Insert cell
myline
=
d3
.
line
(
)
Insert cell
xdata
=
d3
.
range
(
0
,
100
)
Insert cell
val
=
d3
.
map
(
xdata
,
d3
.
randomUniform
(
5
,
10
)
)
Insert cell
x
.
age
=
232
Insert cell
results
=
xdata
.
map
(
indx
=>
(
{
"indx"
:
indx
,
"value"
:
val
[
indx
]
}
)
)
Insert cell
line
=
d3
.
line
(
)
.
x
(
d
=>
d
.
indx
*
5
)
.
y
(
d
=>
d
.
value
*
15
)
Insert cell
linescript
=
line
(
results
)
Insert cell
html
`<svg viewBox="0 0 ${
width
} ${
height
}">
<path d="${
linescript
}" fill="none" stroke="steelblue" stroke-width="1.5" stroke-miterlimit="1"></path>
</svg>`
Insert cell
margin
=
(
{
top
:
20
,
right
:
30
,
bottom
:
30
,
left
:
40
}
)
Insert cell
height
=
240
Insert cell
xAxis
=
g
=>
g
.
attr
(
"transform"
,
`translate(0,${
height
-
margin
.
bottom
})`
)
.
call
(
d3
.
axisBottom
(
x
)
.
ticks
(
width
/
80
)
.
tickSizeOuter
(
0
)
)
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.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
a
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
b
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
c
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
kav
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
x
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
result
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
myline
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
xdata
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
val
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
results
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
line
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
linescript
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
margin
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
height
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
xAxis
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML