Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Gitlab will go into maintenance Friday 3rd February from 9:00 to 10:00
Open sidebar
Fractalis
fractal.js
Commits
9103f7c0
Commit
9103f7c0
authored
May 07, 2018
by
Sascha Herzinger
Browse files
New option for initial control panel expanded
parent
a980e3b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/store/mutations.js
View file @
9103f7c0
...
...
@@ -39,5 +39,6 @@ export default {
},
[
types
.
SET_OPTIONS
]
(
state
,
options
)
{
Object
.
assign
(
state
.
options
,
options
)
state
.
init
()
}
}
src/store/store.js
View file @
9103f7c0
...
...
@@ -14,17 +14,21 @@ const state = {
stateManager
:
null
,
controlPanel
:
{
panels
:
[],
locked
:
false
,
expanded
:
false
locked
:
false
},
subsets
:
[],
filters
:
{
ids
:
{
source
:
null
,
value
:
[]}
},
options
:
{
controlPanelPosition
:
'
left
'
controlPanelPosition
:
'
left
'
,
controlPanelExpanded
:
false
},
init
()
{
this
.
controlPanel
.
expanded
=
this
.
options
.
controlPanelExpanded
return
this
}
}
}
.
init
()
const
store
=
new
Vuex
.
Store
({
state
,
...
...
test/demo/demo.html
View file @
9103f7c0
...
...
@@ -14,9 +14,6 @@
</p>
<input
type=
"button"
onclick=
"loadData()"
value=
"Prepare data for analysis"
/>
<input
type=
"button"
onclick=
"deleteData()"
value=
"Clear analysis cache"
/>
<!--<input type="button" onclick="loadState()" value="load state"/>-->
<label
for=
"state-ids"
>
State ID:
</label>
<input
type=
"text"
id=
"state-ids"
style=
"width: 20vw;"
>
<br/>
<br/>
<div
class=
"charts"
>
...
...
@@ -36,54 +33,73 @@
/* eslint-disable */
const
fjs
=
fractal
.
init
({
handler
:
'
test
'
,
dataSource
:
'
http://local
host
'
,
handler
:
'
demo
'
,
dataSource
:
location
.
protocol
+
'
//
'
+
window
.
location
.
host
,
fractalisNode
:
'
http://localhost
'
,
getAuth
()
{
return
{
token
:
''
}
},
options
:
{
controlPanelPosition
:
'
right
'
controlPanelPosition
:
'
right
'
,
controlPanelExpanded
:
true
}
})
fjs
.
setSubsets
([
])
fjs
.
setSubsets
([])
function
loadData
()
{
fjs
.
loadData
([
{
data_type
:
'
numerical_array
'
,
label
:
'
Expression Data
'
,
num_samples
:
300
,
num_features
:
100
dataType
:
'
numerical
'
,
field
:
'
alcohol
'
},
{
data_type
:
'
numerical
'
,
label
:
'
Numerical Data 1
'
,
num_samples
:
300
dataType
:
'
numerical
'
,
field
:
'
chlorides
'
},
{
data_type
:
'
numerical
'
,
label
:
'
Numerical Data 2
'
,
num_samples
:
300
dataType
:
'
numerical
'
,
field
:
'
citric acid
'
},
{
data_type
:
'
numerical
'
,
label
:
'
Numerical Data 3
'
,
num_samples
:
300
dataType
:
'
numerical
'
,
field
:
'
density
'
},
{
data_type
:
'
categorical
'
,
label
:
'
Categorical Data 1
'
,
num_samples
:
300
,
values
:
[
'
A
'
,
'
B
'
,
'
C
'
,
'
D
'
]
dataType
:
'
numerical
'
,
field
:
'
fixed acidity
'
},
{
data_type
:
'
categorical
'
,
label
:
'
Categorical Data 2
'
,
num_samples
:
300
,
values
:[
'
X
'
,
'
Y
'
]
dataType
:
'
numerical
'
,
field
:
'
free sulfur dioxide
'
},
{
dataType
:
'
numerical
'
,
field
:
'
pH
'
},
{
dataType
:
'
numerical
'
,
field
:
'
quality
'
},
{
dataType
:
'
numerical
'
,
field
:
'
residual sugar
'
},
{
dataType
:
'
numerical
'
,
field
:
'
sulphates
'
},
{
dataType
:
'
numerical
'
,
field
:
'
total sulfur dioxide
'
},
{
dataType
:
'
categorical
'
,
field
:
'
type
'
},
{
dataType
:
'
numerical
'
,
field
:
'
volatile acidity
'
}
])
}
...
...
@@ -92,15 +108,6 @@
fjs
.
clearCache
()
}
function
loadState
()
{
document
.
querySelector
(
'
.state-ids
'
).
value
.
split
(
'
+
'
).
forEach
((
id
,
i
)
=>
{
if
(
id
.
length
)
{
fjs
.
id2chart
(
`.copy-
${
i
+
1
}
`
,
id
)
}
})
}
const
chartStateIDs
=
[]
function
setCharts
()
{
const
vms
=
[
fjs
.
setChart
(
'
correlation-analysis
'
,
'
.chart-1
'
),
...
...
@@ -112,12 +119,6 @@
fjs
.
setChart
(
'
pca-analysis
'
,
'
.chart-7
'
),
fjs
.
setChart
(
'
pca-analysis
'
,
'
.chart-8
'
)
]
vms
.
forEach
((
vm
,
i
)
=>
{
fjs
.
chart2id
(
vm
,
id
=>
{
chartStateIDs
[
i
]
=
id
document
.
querySelector
(
'
#state-ids
'
).
value
=
chartStateIDs
.
join
(
'
+
'
)
})
})
}
window
.
addEventListener
(
'
load
'
,
()
=>
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment