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
fad733f6
Commit
fad733f6
authored
Jan 20, 2015
by
Mathieu Rodic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEATURE] Added autocompletion for ngrams filters in advanced charts, part II
https://forge.iscpif.fr/issues/1363
parent
9ffdc327
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
gargantext.angular.js
static/js/gargantext.angular.js
+21
-17
No files found.
static/js/gargantext.angular.js
View file @
fad733f6
...
@@ -288,6 +288,20 @@ gargantext.controller("DatasetController", function($scope, $http) {
...
@@ -288,6 +288,20 @@ gargantext.controller("DatasetController", function($scope, $http) {
});
});
$scope
.
updateQuery
();
$scope
.
updateQuery
();
};
};
// query ngrams
$scope
.
getNgrams
=
function
(
query
)
{
var
url
=
'/api/nodes/'
+
$scope
.
corpusId
+
'/children/ngrams?limit=10&contain='
+
encodeURI
(
query
);
var
appendTransform
=
function
(
defaults
,
transform
)
{
defaults
=
angular
.
isArray
(
defaults
)
?
defaults
:
[
defaults
];
return
defaults
.
concat
(
transform
);
}
return
$http
.
get
(
url
,
{
transformResponse
:
appendTransform
(
$http
.
defaults
.
transformResponse
,
function
(
value
)
{
console
.
log
(
value
.
data
)
return
value
.
data
;
})
});
};
// filtering informations retrieval
// filtering informations retrieval
$scope
.
operators
=
operators
;
$scope
.
operators
=
operators
;
// add a filter
// add a filter
...
@@ -319,11 +333,13 @@ gargantext.controller("DatasetController", function($scope, $http) {
...
@@ -319,11 +333,13 @@ gargantext.controller("DatasetController", function($scope, $http) {
angular
.
forEach
(
filter
.
value
,
function
(
ngram
)
{
angular
.
forEach
(
filter
.
value
,
function
(
ngram
)
{
termsList
.
push
(
ngram
.
terms
);
termsList
.
push
(
ngram
.
terms
);
});
});
if
(
termsList
.
length
)
{
filters
.
push
({
filters
.
push
({
field
:
'ngrams.terms'
,
field
:
'ngrams.terms'
,
operator
:
'in'
,
operator
:
'in'
,
value
:
termsList
value
:
termsList
});
});
}
}
else
{
}
else
{
filters
.
push
({
filters
.
push
({
field
:
filter
.
entity
.
key
+
'.'
+
filter
.
column
.
key
,
field
:
filter
.
entity
.
key
+
'.'
+
filter
.
column
.
key
,
...
@@ -375,18 +391,6 @@ gargantext.controller("GraphController", function($scope, $http, $element) {
...
@@ -375,18 +391,6 @@ gargantext.controller("GraphController", function($scope, $http, $element) {
columnsHGap
:
5
columnsHGap
:
5
}
}
};
};
// query ngrams
$scope
.
getNgrams
=
function
(
query
)
{
var
appendTransform
=
function
(
defaults
,
transform
)
{
defaults
=
angular
.
isArray
(
defaults
)
?
defaults
:
[
defaults
];
return
defaults
.
concat
(
transform
);
}
return
$http
.
get
(
'/api/nodes/26128/children/ngrams?limit=10&contain='
+
encodeURI
(
query
),
{
transformResponse
:
appendTransform
(
$http
.
defaults
.
transformResponse
,
function
(
value
)
{
return
value
.
data
;
})
});
};
// add a dataset
// add a dataset
$scope
.
addDataset
=
function
()
{
$scope
.
addDataset
=
function
()
{
$scope
.
datasets
.
push
({});
$scope
.
datasets
.
push
({});
...
...
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