Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
e865d164
Commit
e865d164
authored
Oct 03, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
terms table: fully functional cache (with chart select)
parent
79ff47b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
5 deletions
+31
-5
NGrams_dyna_chart_and_table.js
static/lib/gargantext/NGrams_dyna_chart_and_table.js
+31
-5
No files found.
static/lib/gargantext/NGrams_dyna_chart_and_table.js
View file @
e865d164
...
...
@@ -2168,6 +2168,7 @@ function MainTableAndCharts( ngdata , initial , filtersParams, callerLabel) {
// .interpolate("monotone")
// .renderDataPoints({radius: 2, fillOpacity: 0.8, strokeOpacity: 0.8})
.
brushOn
(
false
)
.
rangeChart
(
volumeChart
)
.
title
(
function
(
d
)
{
if
(
isNaN
(
d
.
data
.
value
))
{
console
.
warn
(
JSON
.
stringify
(
d
))
...
...
@@ -2229,6 +2230,9 @@ function MainTableAndCharts( ngdata , initial , filtersParams, callerLabel) {
volumeChart
.
filterAll
();
dc
.
redrawAll
();
// expose selection brush
var
ourBrush
=
volumeChart
.
brush
()
// --------------------------
// DYNATABLE initialization
// --------------------------
...
...
@@ -2346,7 +2350,7 @@ function MainTableAndCharts( ngdata , initial , filtersParams, callerLabel) {
MyTable
.
data
(
'dynatable'
).
sorts
.
clear
();
MyTable
.
data
(
'dynatable'
).
sorts
.
add
(
filtersParams
.
sortk
||
"score"
,
filtersParams
.
sortdirec
||
0
filtersParams
.
sortdirec
||
1
// 1=DESCENDING,
)
...
...
@@ -2364,11 +2368,15 @@ function MainTableAndCharts( ngdata , initial , filtersParams, callerLabel) {
// restore chart filters
if
(
typeof
(
filtersParams
.
from
)
!=
'undefined'
&&
typeof
(
filtersParams
.
to
)
!=
'undefined'
)
{
var
fromto_status
=
[
filtersParams
.
from
,
filtersParams
.
to
]
volumeChart
.
filterAll
()
// re-init
volumeChart
.
filter
(
fromto_status
)
// also does Push2Buffer
// TODO show selection brush on the same interval
var
fromVal
=
filtersParams
.
from
var
toVal
=
filtersParams
.
to
if
(
fromVal
!=
oldest
||
toVal
!=
latest
)
{
// volumeChart.filterAll() // re-init
placeBrush
(
ourBrush
,
fromVal
,
toVal
)
// placeBrush also does volumeChart.filter([fromVal, toVal]) and Push2Buffer
}
}
...
...
@@ -2390,6 +2398,24 @@ function doATest() {
console
.
log
(
"^---------- /TEST -----------^"
)
}
/**
* placeBrush cf. http://bl.ocks.org/timelyportfolio/5c136de85de1c2abb6fc:
* -----------
* Adds the brush (aka "chart's selection zone") programmatically
* (for instance at initialize if we want to restore previous selection)
*/
function
placeBrush
(
myBrush
,
min
,
max
)
{
// define our brush extent
myBrush
.
extent
([
min
,
max
])
// now draw the brush to match our extent
myBrush
(
d3
.
select
(
".brush"
));
// now fire the brushstart, brushmove, and brushend events
myBrush
.
event
(
d3
.
select
(
".brush"
))
}
/**
* tidyAfterUpdate:
* -----------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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