Platform
Resources
Pricing
Sign in
Get started
lengfengif
Workspace
Fork
Published
By
lengfengif
Edited
Apr 11, 2021
Insert cell
Insert cell
{
var
xhr
=
new
XMLHttpRequest
(
)
;
var
cc
=
{
}
;
xhr
.
onload
=
function
(
)
{
// 输出接收到的文字数据
cc
=
xhr
.
responseText
;
}
// 发送同步 GET 请求
xhr
.
open
(
"GET"
,
url1
,
false
)
;
xhr
.
send
(
)
;
return
JSON
.
parse
(
cc
)
}
Insert cell
d3
.
json
(
url1
)
.
then
(
function
(
json
)
{
return
json
;
}
)
;
Insert cell
fetch
(
url1
,
{
method
:
'GET'
,
mode
:
'cors'
,
}
)
.
then
(
(
response
)
=>
{
console
.
log
(
response
)
if
(
response
.
ok
)
{
return
response
.
json
(
)
}
}
)
Insert cell
Insert cell
url
=
"http://127.0.0.1:8000/ss.json"
Insert cell
url1
=
"https://yuque-table-parse.vercel.app/api/table/parse"
Insert cell
d3
=
require
(
"d3@5"
)
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
url
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
url1
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