Platform
Resources
Pricing
Sign in
Get started
min tian
Workspace
Fork
Published
By
min tian
Edited
Jun 1, 2022
2 stars
Insert cell
#
[
test
]
Feder And Observable
Insert cell
Insert cell
FederModule
=
import
(
"https://unpkg.com/@zilliz/feder"
)
Insert cell
Feder
=
FederModule
.
Feder
Insert cell
containerId
=
`container-132568`
Insert cell
initDiv_html
=
{
return
html
`
<div style="width: 300px; height: 50px; background: blue; color: white;">
generate a new div
</div>
`
}
Insert cell
initDiv_d3
=
{
const
div
=
d3
.
create
(
'div'
)
;
div
.
style
(
"width"
,
"300px"
)
.
style
(
"height"
,
"50px"
)
.
style
(
"background"
,
"red"
)
.
style
(
"color"
,
"white"
)
const
text
=
div
.
append
(
"text"
)
text
.
text
(
"hello~~~"
)
return
div
.
node
(
)
}
Insert cell
initDiv_element
=
{
const
div
=
document
.
createElement
(
'div'
)
;
div
.
style
.
width
=
'300px'
;
div
.
style
.
height
=
'50px'
;
div
.
style
.
background
=
"green"
;
div
.
style
.
color
=
"white"
;
div
.
innerHTML
=
`hi~~~`
return
div
}
Insert cell
testDiv_feder
=
{
return
html
`
<div id="${
containerId
}" style="width: 300px; height: 100px; color: red;">
new div
</div>
`
}
Insert cell
// test_dom
d3
.
select
(
`#${
containerId
}`
)
.
style
(
'color'
,
'blue'
)
// d3.select(`#${containerId}`).style('background', 'yellow')
Insert cell
test_dom_func
=
{
d3
.
select
(
`#${
containerId
}`
)
.
style
(
'color'
,
'red'
)
;
d3
.
select
(
`#${
containerId
}`
)
.
style
(
'background'
,
'yellow'
)
;
}
Insert cell
Insert cell
feder
=
new
Feder
(
{
filePath
:
'https://assets.zilliz.com/faiss_ivf_flat_voc_17k_ab112eec72.index'
,
source
:
'faiss'
,
domSelector
:
`#${
containerId
}`
,
viewParams
:
{
mediaType
:
'img'
,
mediaCallback
,
projectSeed
:
1235
,
projectMethod
:
'umap'
,
}
,
}
)
;
Insert cell
feder
.
overview
(
)
Insert cell
// feder.searchRandTestVec()
Insert cell
Insert cell
Insert cell
runFeder
=
{
const
{
containerId
}
=
params
;
const
div
=
d3
.
create
(
"div"
)
;
div
.
attr
(
"id"
,
containerId
)
;
setTimeout
(
(
)
=>
{
const
feder
=
new
Feder
(
params
)
;
// feder.overview();
feder
.
searchRandTestVec
(
)
;
}
,
0
)
;
return
div
.
node
(
)
;
}
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
FederModule
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Feder
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
containerId
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
initDiv_html
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
initDiv_d3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
initDiv_element
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
testDiv_feder
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
test_dom_func
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
mediaCallback
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
feder
Add comment
Copy import
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
params
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
runFeder
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML