Commit 7a0c5fa4 authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge remote-tracking branch 'origin/dev-add-edge-weight-control' into dev

parents 2c54e6d4 abebff62
...@@ -9,32 +9,49 @@ variables: ...@@ -9,32 +9,49 @@ variables:
STACK_OPTS: "--system-ghc" STACK_OPTS: "--system-ghc"
#before_script: #before_script:
#- nix-env -iA nixpkgs.nix nixpkgs.cacert
#- apt-get update #- apt-get update
#- apt-get install make xz-utils #- apt-get install make xz-utils
stages: stages:
- deps - deps
- compile
- test - test
deps: deps:
stage: deps
cache: cache:
paths: paths:
- /nix/store - /nix/store
- node_modules/ - node_modules/
#- ${CI_PROJECT_DIR}/bun.lockb
script: script:
- nix-env -i git - nix-shell shell.nix --run 'bun install --skip-builds'
- nix-shell shell.nix --run 'yarn --skip-builds'
compile:
stage: compile
cache:
paths:
- /nix/store
- node_modules/
- output/
- .spago/
#- ${CI_PROJECT_DIR}/bun.lockb
script:
- nix-shell shell.nix --run fix-bun
- nix-shell shell.nix --run compile
test: test:
stage: test
cache: cache:
# cache per branch name # cache per branch name
# key: ${CI_COMMIT_REF_SLUG} # key: ${CI_COMMIT_REF_SLUG}
paths: paths:
- /nix/store - /nix/store
- node_modules/ - node_modules/
- output/
- .spago/
#- ${CI_PROJECT_DIR}/bun.lockb
script: script:
# find 0.14.5 purescript version here: - nix-shell shell.nix --run fix-bun
# https://lazamar.co.uk/nix-versions/
- nix-env -i git
- nix-shell shell.nix --run 'yarn --skip-builds'
- nix-shell shell.nix --run test-ps - nix-shell shell.nix --run test-ps
...@@ -60,6 +60,27 @@ To build the frontend just execute the install script at the root at the project ...@@ -60,6 +60,27 @@ To build the frontend just execute the install script at the root at the project
**Local instance is ready!** (Example: http://localhost:8000/) **Local instance is ready!** (Example: http://localhost:8000/)
#### [bun](https://bun.sh/)
We use [bun](https://bun.sh/) as the package manager.
Sometimes, when you remove `node_modules` it complains about
`better-sqlite3`:
```
file:///home/przemek/GARGANTEXT/haskell-gargantext/purescript-gargantext/node_modules/spago/bin/bundle.js:61138
throw util.fromLeft(step3);
```
Just issue this (I guess it reinstalls `better-sqlite3` for local bun dev):
```sh
cd node_modules/better-sqlite3
bun install
cd ../..
```
or
```sh
nix-shell shell.nix --run fix-bun
```
### 2. Use Docker setup ### 2. Use Docker setup
You will need docker and docker-compose installed. You will need docker and docker-compose installed.
...@@ -101,6 +122,6 @@ nix-shell --run build ...@@ -101,6 +122,6 @@ nix-shell --run build
To compile CSS (Sass): To compile CSS (Sass):
```shell ```shell
nix-shell --run "yarn css" nix-shell --run "bun css"
``` ```
...@@ -5,4 +5,6 @@ ...@@ -5,4 +5,6 @@
nix-channel --update nix-channel --update
nix-env -iA nixpkgs.nix nixpkgs.cacert nix-env -iA nixpkgs.nix nixpkgs.cacert
nix-shell --show-trace --option build-fallback true --run 'bun install'
nix-shell --show-trace --option build-fallback true --run fix-bun
nix-shell --show-trace --option build-fallback true --run build nix-shell --show-trace --option build-fallback true --run build
...@@ -5,8 +5,8 @@ import ...@@ -5,8 +5,8 @@ import
pkgs.fetchFromGitHub { pkgs.fetchFromGitHub {
owner = "justinwoo"; owner = "justinwoo";
repo = "easy-purescript-nix"; repo = "easy-purescript-nix";
rev = "11d3bd58ce6e32703bf69cec04dc7c38eabe14ba"; rev = "117fd96acb69d7d1727df95b6fde9d8715e031fc";
sha256 = "tESal32bcqqdZO+aKnBzc1GoL2mtnaDtj2y7ociCRGA="; sha256 = "lcIRIOFCdIWEGyKyG/tB4KvxM9zoWuBRDxW+T+mvIb0=";
} }
) { ) {
inherit pkgs; inherit pkgs;
......
import ( import (
builtins.fetchTarball { builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/23.05.tar.gz"; url = "https://github.com/NixOS/nixpkgs/archive/23.11.tar.gz";
} }
) )
...@@ -2,92 +2,85 @@ ...@@ -2,92 +2,85 @@
"name": "Gargantext", "name": "Gargantext",
"version": "0.0.7.1.3", "version": "0.0.7.1.3",
"scripts": { "scripts": {
"generate-purs-packages-nix": "./nix/generate-purs-packages.nix", "build": "spago build",
"generate-psc-packages-nix": "./nix/generate-packages-json.bash", "bundle": "spago bundle --module Main --outfile dist/bundle.js",
"css": "yarn css-themes", "css": "$npm_execpath css-themes",
"css-themes": "yarn css-default-theme && yarn css-dark-theme && yarn css-darkster-theme && yarn css-greyson-theme && yarn css-herbie-theme && yarn css-monotony-theme", "css-themes": "$npm_execpath css-default-theme && $npm_execpath css-dark-theme && $npm_execpath css-darkster-theme && $npm_execpath css-greyson-theme && $npm_execpath css-herbie-theme && $npm_execpath css-monotony-theme",
"css-default-theme": "sass src/sass/themes/default.scss:dist/styles/bootstrap-default.css", "css-default-theme": "sass src/sass/themes/default.scss:dist/styles/bootstrap-default.css",
"css-dark-theme": "cp node_modules/bootstrap-dark/src/bootstrap-dark.css dist/styles/bootstrap-dark.css", "css-dark-theme": "cp node_modules/bootstrap-dark/src/bootstrap-dark.css dist/styles/bootstrap-dark.css",
"css-darkster-theme": "sass src/sass/themes/darkster.scss:dist/styles/bootstrap-darkster.css", "css-darkster-theme": "sass src/sass/themes/darkster.scss:dist/styles/bootstrap-darkster.css",
"css-greyson-theme": "sass src/sass/themes/greyson.scss:dist/styles/bootstrap-greyson.css", "css-greyson-theme": "sass src/sass/themes/greyson.scss:dist/styles/bootstrap-greyson.css",
"css-herbie-theme": "sass src/sass/themes/herbie.scss:dist/styles/bootstrap-herbie.css", "css-herbie-theme": "sass src/sass/themes/herbie.scss:dist/styles/bootstrap-herbie.css",
"css-monotony-theme": "sass src/sass/themes/monotony.scss:dist/styles/bootstrap-monotony.css", "css-monotony-theme": "sass src/sass/themes/monotony.scss:dist/styles/bootstrap-monotony.css",
"css-npm": "npm run css-themes-npm", "docs": "spago docs",
"css-themes-npm": "npm run css-default-theme && npm run css-dark-theme && npm run css-darkster-theme && npm run css-greyson-theme && npm run css-herbie-theme && npm run css-monotony-theme", "minify": "spago bundle --module Main --outfile dist/bundle.min.js --minify",
"docs": "pulp docs -- --format html", "repl": "spago repl",
"repl": "pulp repl",
"clean": "rm -Rf output node_modules",
"clean-js": "rm -Rf node_modules",
"clean-ps": "rm -Rf output",
"server": "serve -l 8008 dist", "server": "serve -l 8008 dist",
"server-ssl": "ssl-serve --ssl dist", "server-ssl": "ssl-serve --ssl dist",
"build": "spago bundle-app --main Main --to dist/bundle.js", "test": "spago test"
"prod": "yarn prod:compile && yarn prod:dce && yarn prod:bundle && yarn prod:pack",
"prod:compile": "pulp build -- -g corefn",
"prod:dce": "zephyr -f Main.main",
"prod:bundle": "pulp browserify --skip-compile -o dce-output -t app.js",
"prod:pack": "parcel build index.html -d prod --public-url . --no-source-maps",
"test-pulp": "pulp test",
"test": "gauge run specs/"
}, },
"dependencies": { "dependencies": {
"@fontsource/crete-round": "^5.0.12", "@fontsource/crete-round": "~5.0.12",
"@fontsource/montserrat": "^5.0.17", "@fontsource/montserrat": "~5.0.17",
"@fontsource/mulish": "^5.0.16", "@fontsource/mulish": "^5.0.16",
"@fontsource/nunito": "^5.0.17", "@fontsource/nunito": "^5.0.17",
"@fontsource/open-sans": "^5.0.25", "@fontsource/open-sans": "~5.0.25",
"@fontsource/oswald": "^5.0.18", "@fontsource/oswald": "~5.0.18",
"@popperjs/core": "^2.9.2", "@popperjs/core": "~2.9.2",
"@urql/core": "^2.3.3", "@urql/core": "~2.3.3",
"aes-js": "^3.1.1", "aes-js": "~3.1.1",
"base-x": "^3.0.2", "base-x": "~3.0.2",
"bootstrap": "^4.6.0", "bootstrap": "~4.6.0",
"bootstrap-dark": "^1.0.3", "bootstrap-dark": "~1.0.3",
"buffer": "^6.0.3", "buffer": "~6.0.3",
"create-react-class": "^15.6.3", "create-react-class": "~15.6.3",
"crypto": "^1.0.1", "crypto": "~1.0.1",
"d3": "^7.6.1", "d3": "~7.6.1",
"echarts": "^5.1.2", "debounce": "^2.0.0",
"echarts-for-react": "^3.0.1", "debouncing": "^22.7.25",
"esbuild": "^0.15.7", "echarts": "~5.1.2",
"graphology": "^0.25.1", "echarts-for-react": "~3.0.1",
"graphology-communities-louvain": "^2.0.1", "graphology": "~0.25.1",
"graphology-layout-forceatlas2": "^0.9.2", "graphology-communities-louvain": "~2.0.1",
"graphology-layout-noverlap": "^0.4.2", "graphology-layout-forceatlas2": "~0.9.2",
"graphology-operators": "^1.6.0", "graphology-layout-noverlap": "~0.4.2",
"graphql": "^15.6.1", "graphology-operators": "~1.6.0",
"graphql-ws": "^5.5.0", "graphql": "~15.6.1",
"highlightjs": "^9.16.2", "graphql-ws": "~5.5.0",
"immer": "^9.0.5", "highlightjs": "~9.16.2",
"isomorphic-unfetch": "^3.1.0", "immer": "~9.0.5",
"markdown-it": "^13.0.1", "isomorphic-unfetch": "~3.1.0",
"prop-types": "^15.6.2", "markdown-it": "~13.0.1",
"pullstate": "^1.20.6", "prop-types": "~15.6.2",
"react-awesome-popover": "^6.1.1", "pullstate": "~1.20.6",
"react-bootstrap": "^1.5.2", "react": "~18.2.0",
"react-dom": "^17.0.2", "react-awesome-popover": "~6.1.1",
"react-tooltip": "^4.2.8", "react-bootstrap": "~1.5.2",
"secp256k1": "^4.0.2", "react-dom": "~18.2.0",
"sigma": "^2.4.0", "react-tooltip": "~4.2.8",
"twgl.js": "^5.0.4", "secp256k1": "~4.0.2",
"sigma": "~2.4.0",
"twgl.js": "~5.0.4",
"use-debounce": "^10.0.0",
"uuid": "8.3.2" "uuid": "8.3.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.15.0", "@babel/core": "~7.15.0",
"@babel/preset-env": "^7.15.6", "@babel/preset-env": "~7.15.6",
"@babel/preset-react": "^7.12.7", "@babel/preset-react": "~7.12.7",
"@getgauge/cli": "^1.4.0", "@getgauge/cli": "~1.4.0",
"parcel": "^2.8.2", "esbuild": "~0.15.7",
"react-testing-library": "^8.0.1", "parcel": "~2.8.2",
"sass": "^1.35.2", "react-testing-library": "~8.0.1",
"serve": "^12.0.0", "sass": "~1.35.2",
"spago": "^0.20.9", "serve": "~12.0.0",
"ssl-serve": "^6.5.8", "spago": "~0.93.29",
"ssl-serve": "~6.5.8",
"taiko": "latest", "taiko": "latest",
"vscode-languageserver": "^7.0.0", "vscode-languageserver": "~7.0.0",
"xhr2": "^0.2.1" "xhr2": "~0.2.1"
}, },
"optionalDependencies": { "optionalDependencies": {
"purescript-language-server": "^0.17.1" "purescript-language-server": "~0.17.1"
} }
} }
let upstream =
https://github.com/garganscript/package-sets/releases/download/v0.1.7/release.dhall
sha256:52886309e1f0158a85427f80c1e3d47ce747c5f14fcec671a81fe5c2c711a6db
let overrides =
{ graphql-client =
{ dependencies =
[ "aff"
, "aff-promise"
, "affjax"
, "affjax-node"
, "affjax-web"
, "argonaut-codecs"
, "argonaut-core"
, "arrays"
, "bifunctors"
, "control"
, "datetime"
, "debug"
, "effect"
, "either"
, "enums"
, "exceptions"
, "foldable-traversable"
, "foreign"
, "foreign-object"
, "functions"
, "halogen-subscriptions"
, "heterogeneous"
, "http-methods"
, "integers"
, "lists"
, "maybe"
, "media-types"
, "newtype"
, "node-buffer"
, "node-fs"
, "nullable"
, "numbers"
, "ordered-collections"
, "parsing"
, "prelude"
, "profunctor"
, "profunctor-lenses"
, "psci-support"
, "quickcheck"
, "record"
, "spec"
, "spec-discovery"
, "string-parsers"
, "strings"
, "strings-extra"
, "transformers"
, "tuples"
, "unicode"
, "unsafe-coerce"
, "variant"
]
, repo =
"https://github.com/OxfordAbstracts/purescript-graphql-client.git"
, version = "v9.2.2"
}
, jest =
{ dependencies =
[ "aff"
, "aff-promise"
, "effect"
, "foldable-traversable"
, "prelude"
, "psci-support"
]
, repo = "https://github.com/nonbili/purescript-jest"
, version = "018543987af27db6a3842048b6b3f5ec47609087"
}
, markdown-it =
{ dependencies =
[ "effect"
, "foldable-traversable"
, "foreign"
, "jest"
, "options"
, "prelude"
, "tuples"
]
, repo = "https://github.com/nonbili/purescript-markdown-it"
, version = "f6e8ee91298f2fc13c4277e75a19e0538de5f7a2"
}
, record-extra =
{ dependencies =
[ "arrays"
, "effect"
, "functions"
, "lists"
, "maybe"
, "prelude"
, "record"
, "test-unit"
, "tuples"
, "typelevel-prelude"
]
, repo = "https://github.com/justinwoo/purescript-record-extra"
, version = "v5.0.1"
}
}
let additions =
{ convertable-options =
{ dependencies = [ "console", "effect", "maybe", "record" ]
, repo = "https://github.com/natefaubion/purescript-convertable-options"
, version = "v1.0.0"
}
, data-default =
{ dependencies =
[ "assert", "lists", "maybe", "record", "effect", "prelude" ]
, repo = "https://github.com/thought2/purescript-data-default"
, version = "350e600a5a022c9599865a2dd14196b442f59bcc"
}
, dom-filereader =
{ dependencies = [ "aff", "arraybuffer-types", "web-file", "web-html" ]
, repo = "https://github.com/nwolverson/purescript-dom-filereader"
, version = "v5.0.0"
}
, sequences =
{ dependencies =
[ "arrays"
, "assert"
, "console"
, "control"
, "effect"
, "lazy"
, "maybe"
, "newtype"
, "nonempty"
, "partial"
, "prelude"
, "profunctor"
, "psci-support"
, "tuples"
, "unfoldable"
, "unsafe-coerce"
]
, repo = "https://github.com/garganscript/purescript-sequences.git"
, version = "recursion-fix"
}
, read =
{ dependencies = [ "prelude", "maybe", "strings" ]
, repo = "https://github.com/truqu/purescript-read"
, version = "v1.0.1"
}
, simple-json-generics =
{ dependencies =
[ "assert"
, "control"
, "effect"
, "either"
, "foreign"
, "partial"
, "prelude"
, "simple-json"
, "transformers"
, "typelevel-prelude"
]
, repo =
"https://github.com/garganscript/purescript-simple-json-generics"
, version = "master"
}
, spec-discovery =
{ dependencies = [ "prelude", "effect", "arrays", "spec", "node-fs" ]
, repo = "https://github.com/purescript-spec/purescript-spec-discovery"
, version = "v8.0.0"
}
, spec-quickcheck =
{ dependencies = [ "prelude", "aff", "random", "quickcheck", "spec" ]
, repo = "https://github.com/purescript-spec/purescript-spec-quickcheck"
, version = "v3.1.0"
}
, string-search =
{ dependencies =
[ "arrays"
, "enums"
, "foldable-traversable"
, "int64"
, "integers"
, "lists"
, "maybe"
, "ordered-collections"
, "partial"
, "prelude"
, "strings"
, "tuples"
, "uint"
]
, repo =
"https://gitlab.iscpif.fr/gargantext/purescript-string-search.git"
, version = "v0.1.6"
}
, tuples-native =
{ dependencies =
[ "console"
, "effect"
, "functions"
, "prelude"
, "tuples"
, "typelevel"
, "typelevel-prelude"
]
, repo = "https://github.com/garganscript/purescript-tuples-native"
, version = "v2.3.0"
}
, versions =
{ dependencies = [ "prelude" ]
, repo = "https://github.com/hdgarrood/purescript-versions.git"
, version = "v6.0.0"
}
, web-url =
{ dependencies = [ "prelude" ]
, repo = "https://github.com/mjepronk/purescript-web-url"
, version = "v2.0.0"
}
}
in upstream // overrides // additions
...@@ -2,51 +2,45 @@ ...@@ -2,51 +2,45 @@
let let
easy-ps = import ./nix/easy-ps.nix { inherit pkgs; }; easy-ps = import ./nix/easy-ps.nix { inherit pkgs; };
purs-packages = import ./purs-packages.nix { inherit pkgs; }; # sometimes bun is broken because of better-sqlite3
fix-bun = pkgs.writeShellScriptBin "fix-bun" ''
purs-project = import ./nix/purs-project.nix { inherit pkgs; };
build-purs = pkgs.writeShellScriptBin "build-purs" ''
#!/usr/bin/env bash #!/usr/bin/env bash
purs compile ${toString purs-project.sourceGlobs} "src/**/*.purs" "test/**/*.purs" set -e
cd ./node_modules/better-sqlite3
bun install
''; '';
build = pkgs.writeShellScriptBin "build" '' compile = pkgs.writeShellScriptBin "compile" ''
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
echo "Installing JS Dependencies" echo "Installing JS Dependencies"
yarn #yarn
bun install
echo "Compiling" echo "Compiling"
#build-purs bun run build
#spago build '';
#echo "Bundling"
#pulp browserify --skip-compile -t dist/bundle.js --src-path output build = pkgs.writeShellScriptBin "build" ''
#browserify #!/usr/bin/env bash
set -e
# 0.15 # 0.15
spago bundle-app --main Main --to dist/bundle.js echo "Bundling"
bun run bundle
''; '';
build-suggestions = pkgs.writeShellScriptBin "build-suggestions" '' build-suggestions = pkgs.writeShellScriptBin "build-suggestions" ''
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
echo "Installing JS Dependencies"
yarn
rm -rf ./output rm -rf ./output
echo "Compiling"
#build-purs
#spago build
#echo "Bundling"
#pulp browserify --skip-compile -t dist/bundle.js --src-path output
#browserify
# 0.15 # 0.15
spago bundle-app --main Main --to dist/bundle.js --purs-args "--json-errors" | jq -r '.warnings | map(select(.errorCode | test("UnusedDctorExplicitImport|UnusedDctorImport|UnusedDeclaration|UnusedExplicitImport|UnusedImport|UnusedName|UnusedTypeVar"))) | map(select(.filename | test("^.spago") | not)) | map("[\(.filename)::\(.position.startLine)] \(.message)\n \(.suggestion)") | join("\n----------\n")' echo "Bundling"
bun spago bundle --module Main --outfile dist/bundle.js --purs-args "--json-errors" | jq -r '.warnings | map(select(.errorCode | test("UnusedDctorExplicitImport|UnusedDctorImport|UnusedDeclaration|UnusedExplicitImport|UnusedImport|UnusedName|UnusedTypeVar"))) | map(select(.filename | test("^.spago") | not)) | map("[\(.filename)::\(.position.startLine)] \(.message)\n \(.suggestion)") | join("\n----------\n")'
''; '';
...@@ -54,15 +48,16 @@ let ...@@ -54,15 +48,16 @@ let
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
yarn css #yarn css
bun run css
''; '';
serve = pkgs.writeShellScriptBin "serve" '' serve = pkgs.writeShellScriptBin "serve" ''
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
yarn server #yarn server
bun run server
''; '';
...@@ -71,60 +66,39 @@ let ...@@ -71,60 +66,39 @@ let
set -e set -e
echo "Build watch" echo "Build watch"
spago build -w --then browserify bun spago build -w --then browserify
''; '';
build-zephyr = pkgs.writeShellScriptBin "build-zephyr" '' build-zephyr = pkgs.writeShellScriptBin "build-zephyr" ''
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
spago build --purs-args '--codegen corefn,js' bun spago build --purs-args '--codegen corefn,js'
zephyr -f Main.main zephyr -f Main.main
browserify-zephyr browserify-zephyr
''; '';
browserify = pkgs.writeShellScriptBin "browserify" ''
#!/usr/bin/env bash
set -e
pulp browserify --skip-compile -t dist/bundle.js --src-path output
'';
browserify-zephyr = pkgs.writeShellScriptBin "browserify-zephyr" ''
#!/usr/bin/env bash
set -e
pulp browserify --skip-compile -t dist/bundle.js -o dce-output
#purs bundle -o dist/bundle.js -m Main dce-output/**/*.js
'';
minify-bundle = pkgs.writeShellScriptBin "minify-bundle" '' minify-bundle = pkgs.writeShellScriptBin "minify-bundle" ''
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
minify dist/bundle.js > dist/bundle.min.js bun run minify
''; '';
repl = pkgs.writeShellScriptBin "repl" '' repl = pkgs.writeShellScriptBin "repl" ''
#!/usr/bin/env bash #!/usr/bin/env bash
spago repl bun run repl
''; '';
test-ps = pkgs.writeShellScriptBin "test-ps" '' test-ps = pkgs.writeShellScriptBin "test-ps" ''
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
echo "Compiling" compile
yarn
#spago build
#build-purs
echo "Testing" echo "Testing"
spago -v -x test.dhall test --main Test.Main bun run test
# spago -x test.dhall bundle-app --main Test.Main --to dist/test-bundle.js --platform node
# pulp browserify --skip-compile -t dist/bundle.js --src-path output
# pulp test --src-path output --test-path output
#NODE_PATH=output node -e "require('Test.Main').main();"
''; '';
# TODO: Remove this when nixpkgs is updated to newer version (23.05 # TODO: Remove this when nixpkgs is updated to newer version (23.05
...@@ -133,39 +107,33 @@ let ...@@ -133,39 +107,33 @@ let
in in
pkgs.mkShell { pkgs.mkShell {
buildInputs = [ buildInputs = [
easy-ps.purs-0_15_7 easy-ps.purs-0_15_15
easy-ps.psc-package
easy-ps.dhall-json-simple
easy-ps.zephyr easy-ps.zephyr
browserify pkgs.ijq
browserify-zephyr pkgs.jq
#pkgs.esbuild
pkgs.nodejs
#pkgs.yarn
pkgs.bun
pkgs.sqlite
# scripts
build-css build-css
build-purs
build-suggestions build-suggestions
build-watch build-watch
build-zephyr build-zephyr
build build
pkgs.ijq compile
pkgs.jq fix-bun
minify-bundle minify-bundle
#pkgs.closurecompiler
pkgs.esbuild
pkgs.minify
pkgs.nodejs
#pkgs.nodePackages.purescript-language-server
#pkgs.python # needed for msgpack etc
#nodejs_20_3_1
repl repl
serve serve
pkgs.pulp
pkgs.spago
pkgs.yarn
test-ps test-ps
]; ];
shellHook = '' #shellHook = ''
export PURS_IDE_SOURCES='${toString purs-project.unquotedSourceGlobs}' # export PURS_IDE_SOURCES='${toString purs-project.unquotedSourceGlobs}'
''; #'';
} }
## how to build the project with nix dependencies: ## how to build the project with nix dependencies:
......
{-
Welcome to a Spago project!
You can edit this file as you like.
Need help? See the following resources:
- Spago documentation: https://github.com/purescript/spago
- Dhall language tour: https://docs.dhall-lang.org/tutorials/Language-Tour.html
When creating a new Spago project, you can use
`spago init --no-comments` or `spago init -C`
to generate this file without the comments in this block.
-}
{ name = "gargantext"
, dependencies =
[ "aff"
, "aff-promise"
, "affjax"
, "affjax-web"
, "argonaut"
, "argonaut-codecs"
, "argonaut-core"
, "arraybuffer-types"
, "arrays"
, "bifunctors"
, "colors"
, "console"
, "control"
, "convertable-options"
, "css"
, "d3"
, "data-default"
, "datetime"
, "debug"
, "dom-filereader"
, "dom-simple"
, "effect"
, "either"
, "enums"
, "exceptions"
, "ffi-simple"
, "foldable-traversable"
, "foreign"
, "foreign-object"
, "form-urlencoded"
, "formatters"
, "functions"
, "graphql-client"
, "heterogeneous"
, "http-methods"
, "integers"
, "js-timers"
, "lists"
, "markdown-it"
, "maybe"
, "media-types"
, "milkis"
, "newtype"
, "nonempty"
, "now"
, "nullable"
, "numbers"
, "ordered-collections"
, "orders"
, "parallel"
, "partial"
, "prelude"
, "profunctor-lenses"
, "psci-support"
, "random"
, "react"
, "reactix"
, "record"
, "record-extra"
, "routing"
, "sequences"
, "simple-json"
, "simple-json-generics"
, "string-search"
, "strings"
, "strings-extra"
, "stringutils"
, "these"
, "toestand"
, "transformers"
, "tuples"
, "tuples-native"
, "typelevel"
, "typelevel-prelude"
, "unfoldable"
, "unordered-collections"
, "unsafe-coerce"
, "uri"
, "uuid"
, "validation"
, "web-file"
, "web-html"
, "web-storage"
, "web-url"
, "web-xhr"
]
, packages = ./packages.dhall
, sources = [ "src/**/*.purs" ]
}
This diff is collapsed.
workspace:
packageSet:
registry: 50.13.1
extraPackages:
# garganscript packages
d3:
git: https://github.com/garganscript/purescript-d3.git
ref: v0.11.0
debouncing: 0.1.2
reactix: 0.6.1
string-search:
git: https://gitlab.iscpif.fr/gargantext/purescript-string-search.git
ref: spago-next
# custom forks
data-default:
git: https://github.com/garganscript/purescript-data-default.git
ref: v0.4.0
graphql-client:
git: https://github.com/garganscript/purescript-graphql-client.git
ref: spago-next-9.3.2
markdown-it:
git: https://github.com/garganscript/purescript-markdown-it.git
ref: spago-next
sequences:
git: https://github.com/garganscript/purescript-sequences.git
ref: v3.0.2-spago-next
simple-json-generics: 0.2.1
tuples-native:
git: https://github.com/garganscript/purescript-tuples-native.git
ref: v2.3.0-spago-next
# for tests
spec-discovery:
git: https://github.com/garganscript/purescript-spec-discovery.git
ref: v8.2.0-spago-next
package:
name: gargantext
dependencies:
# debugging
- aff: ">=7.1.0 <8.0.0"
- aff-promise: ">=4.0.0 <5.0.0"
- affjax: ">=13.0.0 <14.0.0"
- affjax-web: ">=1.0.0 <2.0.0"
- argonaut: ">=9.0.0 <10.0.0"
- argonaut-codecs: ">=9.1.0 <10.0.0"
- argonaut-core: ">=7.0.0 <8.0.0"
- arraybuffer-types: ">=3.0.2 <4.0.0"
- arrays: ">=7.3.0 <8.0.0"
- bifunctors: ">=6.0.0 <7.0.0"
- colors: ">=7.0.1 <8.0.0"
- console: ">=6.1.0 <7.0.0"
- control: ">=6.0.0 <7.0.0"
- convertable-options: ">=1.0.0 <2.0.0"
- css: ">=6.0.0 <7.0.0"
- d3: "*"
- data-default: "*"
- datetime: ">=6.1.0 <7.0.0"
- debouncing: ">=0.1.0 <0.2.0"
- debug: ">=6.0.2 <7.0.0"
- dom-filereader: ">=7.0.0 <8.0.0"
- dom-simple: ">=0.4.0 <0.5.0"
- effect: ">=4.0.0 <5.0.0"
- either: ">=6.1.0 <7.0.0"
- enums: ">=6.0.1 <7.0.0"
- exceptions: ">=6.0.0 <7.0.0"
- ffi-simple: ">=0.5.1 <0.6.0"
- foldable-traversable: ">=6.0.0 <7.0.0"
- foreign: ">=7.0.0 <8.0.0"
- foreign-object: ">=4.1.0 <5.0.0"
- form-urlencoded: ">=7.0.0 <8.0.0"
- formatters: ">=7.0.0 <8.0.0"
- functions: ">=6.0.0 <7.0.0"
- graphql-client: "*"
- heterogeneous: ">=0.6.0 <0.7.0"
- http-methods: ">=6.0.0 <7.0.0"
- integers: ">=6.0.0 <7.0.0"
- js-timers: ">=6.1.0 <7.0.0"
- lists: ">=7.0.0 <8.0.0"
- markdown-it: "*"
- maybe: ">=6.0.0 <7.0.0"
- media-types: ">=6.0.0 <7.0.0"
- milkis: ">=9.0.0 <10.0.0"
- newtype: ">=5.0.0 <6.0.0"
- nonempty: ">=7.0.0 <8.0.0"
- now: ">=6.0.0 <7.0.0"
- nullable: ">=6.0.0 <7.0.0"
- numbers: ">=9.0.1 <10.0.0"
- ordered-collections: ">=3.2.0 <4.0.0"
- orders: ">=6.0.0 <7.0.0"
- parallel: ">=7.0.0 <8.0.0"
- partial: ">=4.0.0 <5.0.0"
- prelude: ">=6.0.1 <7.0.0"
- profunctor-lenses: ">=8.0.0 <9.0.0"
- random: ">=6.0.0 <7.0.0"
- react: ">=11.0.0 <12.0.0"
- reactix: ">=0.6.1 <0.7.0"
- record: ">=4.0.0 <5.0.0"
- record-extra: ">=5.0.1 <6.0.0"
- routing: ">=11.0.0 <12.0.0"
- sequences: "*"
- simple-json: ">=9.0.0 <10.0.0"
- simple-json-generics: "*"
- string-search: "*"
- strings: ">=6.0.1 <7.0.0"
- strings-extra: ">=4.0.0 <5.0.0"
- stringutils: ">=0.0.12 <0.0.13"
- these: ">=6.0.0 <7.0.0"
- toestand: ">=0.9.0 <0.10.0"
- transformers: ">=6.0.0 <7.0.0"
- tuples: ">=7.0.0 <8.0.0"
- tuples-native: "*"
- typelevel: ">=6.0.0 <7.0.0"
- typelevel-prelude: ">=7.0.0 <8.0.0"
- unfoldable: ">=6.0.0 <7.0.0"
- unordered-collections: ">=3.1.0 <4.0.0"
- unsafe-coerce: ">=6.0.0 <7.0.0"
- uri: ">=9.0.0 <10.0.0"
- uuid: ">=9.0.0 <10.0.0"
- validation: ">=6.0.0 <7.0.0"
- web-file: ">=4.0.0 <5.0.0"
- web-html: ">=4.1.0 <5.0.0"
- web-storage: ">=5.0.0 <6.0.0"
- web-url: ">=2.0.0 <3.0.0"
- web-xhr: ">=5.0.1 <6.0.0"
build:
# Be strict about missing packages
# https://github.com/purescript/spago/issues/1211#issuecomment-2066083651
pedanticPackages: true
# convert compiler warnings to errors:
# strict:
# true
censorProjectWarnings:
- UnusedDctorExplicitImport
- UnusedDctorImport
- UnusedDeclaration
- UnusedExplicitImport
- UnusedImport
- UnusedName
- UnusedTypeVar
test:
main: Test.Main
dependencies:
- spec
- spec-discovery
- spec-quickcheck
...@@ -235,6 +235,8 @@ graphViewCpt = R.memo' $ here.component "graphView" cpt where ...@@ -235,6 +235,8 @@ graphViewCpt = R.memo' $ here.component "graphView" cpt where
, sigmaRef , sigmaRef
} _ = do } _ = do
-- { edgeConfluence, edgeWeight } <- GraphStore.use
-- edgeConfluence' <- R2.useLive' edgeConfluence -- edgeConfluence' <- R2.useLive' edgeConfluence
-- edgeWeight' <- R2.useLive' edgeWeight -- edgeWeight' <- R2.useLive' edgeWeight
-- nodeSize' <- R2.useLive' nodeSize -- nodeSize' <- R2.useLive' nodeSize
...@@ -410,7 +412,11 @@ hooksTransformGraph = do ...@@ -410,7 +412,11 @@ hooksTransformGraph = do
params <- transformGraphStoreParams params <- transformGraphStoreParams
graph' <- R2.useLive' store.graph graph' <- R2.useLive' store.graph
-- R.useEffect' $ do
-- here.log2 "[hooksTransformGraph] hashed" $ hashLiveProps params
R.useEffect2' (hashLiveProps params) graph' $ do R.useEffect2' (hashLiveProps params) graph' $ do
-- here.log2 "[hooksTransformGraph] transformed" $ transformGraph graph' params
T.write_ (transformGraph graph' params) store.transformedGraph T.write_ (transformGraph graph' params) store.transformedGraph
transformGraph :: SigmaxT.SGraph -> Record LiveProps -> SigmaxT.SGraph transformGraph :: SigmaxT.SGraph -> Record LiveProps -> SigmaxT.SGraph
...@@ -450,8 +456,8 @@ transformGraph graph { edgeConfluence' ...@@ -450,8 +456,8 @@ transformGraph graph { edgeConfluence'
edge { hidden = true } edge { hidden = true }
edgeHideWeight :: Record SigmaxT.Edge -> Record SigmaxT.Edge edgeHideWeight :: Record SigmaxT.Edge -> Record SigmaxT.Edge
edgeHideWeight edge@{ weightIdx } = edgeHideWeight edge@{ weight } =
if Range.within edgeWeight' $ toNumber weightIdx then if Range.within edgeWeight' weight then
edge edge
else else
edge { hidden = true } edge { hidden = true }
......
...@@ -44,6 +44,7 @@ type Store = ...@@ -44,6 +44,7 @@ type Store =
, edgeConfluence :: T.Box Range.NumberRange , edgeConfluence :: T.Box Range.NumberRange
, edgeConfluenceRange :: T.Box Range.NumberRange , edgeConfluenceRange :: T.Box Range.NumberRange
, edgeWeight :: T.Box Range.NumberRange , edgeWeight :: T.Box Range.NumberRange
, edgeWeightRange :: T.Box Range.NumberRange
, forceAtlasState :: T.Box SigmaxT.ForceAtlasState , forceAtlasState :: T.Box SigmaxT.ForceAtlasState
, noverlapState :: T.Box SigmaxT.NoverlapState , noverlapState :: T.Box SigmaxT.NoverlapState
, graphStage :: T.Box GET.Stage , graphStage :: T.Box GET.Stage
...@@ -79,6 +80,7 @@ type State = ...@@ -79,6 +80,7 @@ type State =
, edgeConfluence :: Range.NumberRange , edgeConfluence :: Range.NumberRange
, edgeConfluenceRange :: Range.NumberRange , edgeConfluenceRange :: Range.NumberRange
, edgeWeight :: Range.NumberRange , edgeWeight :: Range.NumberRange
, edgeWeightRange :: Range.NumberRange
, forceAtlasState :: SigmaxT.ForceAtlasState , forceAtlasState :: SigmaxT.ForceAtlasState
, noverlapState :: SigmaxT.NoverlapState , noverlapState :: SigmaxT.NoverlapState
, graphStage :: GET.Stage , graphStage :: GET.Stage
...@@ -109,6 +111,7 @@ options :: ...@@ -109,6 +111,7 @@ options ::
, mouseSelectorSize :: Number , mouseSelectorSize :: Number
, multiSelectEnabled :: Boolean , multiSelectEnabled :: Boolean
, edgeConfluence :: Range.NumberRange , edgeConfluence :: Range.NumberRange
, edgeWeight :: Range.NumberRange
, graphStage :: GET.Stage , graphStage :: GET.Stage
, nodeSize :: Range.NumberRange , nodeSize :: Range.NumberRange
--, showLouvain :: Boolean --, showLouvain :: Boolean
...@@ -131,6 +134,7 @@ options = ...@@ -131,6 +134,7 @@ options =
, labelRenderedSizeThreshold : 2.0 , labelRenderedSizeThreshold : 2.0
, mouseSelectorSize : 15.0 , mouseSelectorSize : 15.0
, edgeConfluence : Range.Closed { min: 0.0, max: 1.0 } , edgeConfluence : Range.Closed { min: 0.0, max: 1.0 }
, edgeWeight : Range.Closed { min: 0.0, max: 1.0 }
, graphStage : GET.Init , graphStage : GET.Init
, nodeSize : Range.Closed { min: 0.0, max: 100.0 } , nodeSize : Range.Closed { min: 0.0, max: 100.0 }
--, showLouvain : false --, showLouvain : false
......
...@@ -11,7 +11,7 @@ import Effect.Timer (setTimeout) ...@@ -11,7 +11,7 @@ import Effect.Timer (setTimeout)
import Gargantext.Components.Bootstrap as B import Gargantext.Components.Bootstrap as B
import Gargantext.Components.GraphExplorer.Store as GraphStore import Gargantext.Components.GraphExplorer.Store as GraphStore
import Gargantext.Components.GraphExplorer.Toolbar.Buttons (cameraButton, centerButton, edgesToggleButton, louvainButton, pauseForceAtlasButton, pauseNoverlapButton, multiSelectEnabledButton) import Gargantext.Components.GraphExplorer.Toolbar.Buttons (cameraButton, centerButton, edgesToggleButton, louvainButton, pauseForceAtlasButton, pauseNoverlapButton, multiSelectEnabledButton)
import Gargantext.Components.GraphExplorer.Toolbar.RangeControl (edgeConfluenceControl, nodeSizeControl) import Gargantext.Components.GraphExplorer.Toolbar.RangeControl (edgeConfluenceControl, edgeWeightControl, nodeSizeControl)
import Gargantext.Components.GraphExplorer.Toolbar.SlideButton (labelSizeButton, labelRenderedSizeThresholdButton, mouseSelectorSizeSlider) import Gargantext.Components.GraphExplorer.Toolbar.SlideButton (labelSizeButton, labelRenderedSizeThresholdButton, mouseSelectorSizeSlider)
import Gargantext.Components.GraphExplorer.Types as GET import Gargantext.Components.GraphExplorer.Types as GET
import Gargantext.Hooks.Sigmax.ForceAtlas2 as ForceAtlas import Gargantext.Hooks.Sigmax.ForceAtlas2 as ForceAtlas
...@@ -52,7 +52,8 @@ controlsCpt = R.memo' $ here.component "controls" cpt where ...@@ -52,7 +52,8 @@ controlsCpt = R.memo' $ here.component "controls" cpt where
-- | -- |
{ edgeConfluence { edgeConfluence
, edgeConfluenceRange , edgeConfluenceRange
-- , edgeWeight , edgeWeight
, edgeWeightRange
, forceAtlasState , forceAtlasState
, noverlapState , noverlapState
, graph , graph
...@@ -80,6 +81,7 @@ controlsCpt = R.memo' $ here.component "controls" cpt where ...@@ -80,6 +81,7 @@ controlsCpt = R.memo' $ here.component "controls" cpt where
selectedNodeIds' <- R2.useLive' selectedNodeIds selectedNodeIds' <- R2.useLive' selectedNodeIds
showSidebar' <- R2.useLive' showSidebar showSidebar' <- R2.useLive' showSidebar
edgeConfluenceRange' <- R2.useLive' edgeConfluenceRange edgeConfluenceRange' <- R2.useLive' edgeConfluenceRange
edgeWeightRange' <- R2.useLive' edgeWeightRange
nodeSizeRange' <- R2.useLive' nodeSizeRange nodeSizeRange' <- R2.useLive' nodeSizeRange
-- session <- useSession -- session <- useSession
...@@ -207,12 +209,10 @@ controlsCpt = R.memo' $ here.component "controls" cpt where ...@@ -207,12 +209,10 @@ controlsCpt = R.memo' $ here.component "controls" cpt where
} }
, ,
gap, gap gap, gap
, , edgeWeightControl
labelRenderedSizeThresholdButton
{ forceAtlasState { forceAtlasState
, sigmaRef , range: edgeWeightRange'
, state: labelRenderedSizeThreshold , state: edgeWeight }
}
] ]
, ,
-- Run spatialization -- Run spatialization
...@@ -321,12 +321,12 @@ controlsCpt = R.memo' $ here.component "controls" cpt where ...@@ -321,12 +321,12 @@ controlsCpt = R.memo' $ here.component "controls" cpt where
{ forceAtlasState { forceAtlasState
, range: edgeConfluenceRange' , range: edgeConfluenceRange'
, state: edgeConfluence } , state: edgeConfluence }
{- , , gap
edgeWeightControl , labelRenderedSizeThresholdButton
{ forceAtlasState { forceAtlasState
, range: edgeWeightRange , sigmaRef
, state: edgeWeight } , state: labelRenderedSizeThreshold
-} }
, ,
gap, gap gap, gap
, ,
......
...@@ -6,19 +6,29 @@ module Gargantext.Components.GraphExplorer.Toolbar.RangeControl ...@@ -6,19 +6,29 @@ module Gargantext.Components.GraphExplorer.Toolbar.RangeControl
, nodeSizeControl , nodeSizeControl
) where ) where
import Data.Maybe (Maybe(..))
import Data.Tuple.Nested((/\))
import Debug (spy)
import Effect.Aff (launchAff_)
import Effect.Class (liftEffect)
import Effect.Debouncing as Debounce
import FFI.Simple (delay)
import Gargantext.Components.RangeSlider as RS
import Gargantext.Hooks.Sigmax.Types as SigmaxTypes
import Gargantext.Utils.Range as Range
import Gargantext.Utils.Reactix as R2
import Prelude import Prelude
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Toestand as T import Toestand as T
import Gargantext.Components.RangeSlider as RS
import Gargantext.Hooks.Sigmax.Types as SigmaxTypes
import Gargantext.Utils.Range as Range
import Gargantext.Utils.Reactix as R2
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer.Toolbar.RangeControl" here = R2.here "Gargantext.Components.GraphExplorer.Toolbar.RangeControl"
defaultThrottleInterval :: Int
defaultThrottleInterval = 500
type Props = type Props =
( caption :: String ( caption :: String
, sliderProps :: Record RS.Props , sliderProps :: Record RS.Props
...@@ -54,22 +64,24 @@ edgeConfluenceControlCpt :: R.Component EdgeConfluenceControlProps ...@@ -54,22 +64,24 @@ edgeConfluenceControlCpt :: R.Component EdgeConfluenceControlProps
edgeConfluenceControlCpt = here.component "edgeConfluenceControl" cpt edgeConfluenceControlCpt = here.component "edgeConfluenceControl" cpt
where where
cpt { forceAtlasState cpt { forceAtlasState
, range: Range.Closed { min, max } , range
, state , state
} _ = do } _ = do
forceAtlasState' <- R2.useLive' forceAtlasState forceAtlasState' <- R2.useLive' forceAtlasState
state' <- T.useLive T.unequal state state' <- T.useLive T.unequal state
pure $ rangeControl { pure $ rangeControl {
caption: "Edge Confluence Weight" caption: "Edge Confluence Weight"
, sliderProps: { , sliderProps: {
bounds: Range.Closed { min, max } bounds: range
, epsilon: 0.01 , epsilon: 0.01
, height: 5.0 , height: 5.0
, initialValue: state' , initialValue: state'
, onChange: \rng -> T.write_ rng state , onChange: \rng -> T.write_ rng state
, status: SigmaxTypes.forceAtlasComponentStatus forceAtlasState' , status: SigmaxTypes.forceAtlasComponentStatus forceAtlasState'
, step: 1.0 , step: 1.0
, throttleInterval: Just defaultThrottleInterval
, width: 10.0 , width: 10.0
} }
} }
...@@ -88,22 +100,27 @@ edgeWeightControlCpt :: R.Component EdgeWeightControlProps ...@@ -88,22 +100,27 @@ edgeWeightControlCpt :: R.Component EdgeWeightControlProps
edgeWeightControlCpt = here.component "edgeWeightControl" cpt edgeWeightControlCpt = here.component "edgeWeightControl" cpt
where where
cpt { forceAtlasState cpt { forceAtlasState
, range: Range.Closed { min, max } , range: range@(Range.Closed { min, max })
, state , state
} _ = do } _ = do
forceAtlasState' <- R2.useLive' forceAtlasState forceAtlasState' <- R2.useLive' forceAtlasState
state' <- T.useLive T.unequal state state' <- T.useLive T.unequal state
pure $ rangeControl { pure $ rangeControl {
caption: "Edge Weight" caption: "Edge Weight"
, sliderProps: { , sliderProps: {
bounds: Range.Closed { min, max } bounds: range
, initialValue: state' , initialValue: state'
, epsilon: 1.0 , epsilon: (max - min) / 100.0
, height: 5.0 , height: 5.0
, onChange: \rng -> T.write_ rng state , onChange: \rng -> T.write_ rng state
-- , onChange: \rng -> Debounce.call onChange rng
-- , onChange: \rng -> RD.callDebouncedCallback rd rng
-- , onChange: onChange'
, status: SigmaxTypes.forceAtlasComponentStatus forceAtlasState' , status: SigmaxTypes.forceAtlasComponentStatus forceAtlasState'
, step: 1.0 , step: 1.0
, throttleInterval: Just defaultThrottleInterval
, width: 10.0 , width: 10.0
} }
} }
...@@ -138,6 +155,7 @@ nodeSizeControlCpt = here.component "nodeSizeControl" cpt ...@@ -138,6 +155,7 @@ nodeSizeControlCpt = here.component "nodeSizeControl" cpt
, onChange: \rng -> T.write_ rng state , onChange: \rng -> T.write_ rng state
, status: SigmaxTypes.forceAtlasComponentStatus forceAtlasState' , status: SigmaxTypes.forceAtlasComponentStatus forceAtlasState'
, step: 1.0 , step: 1.0
, throttleInterval: Just defaultThrottleInterval
, width: 10.0 , width: 10.0
} }
} }
...@@ -7,10 +7,11 @@ module Gargantext.Components.GraphExplorer.Toolbar.SlideButton ...@@ -7,10 +7,11 @@ module Gargantext.Components.GraphExplorer.Toolbar.SlideButton
) where ) where
import Data.Map as Map import Data.Map as Map
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..), fromMaybe)
import Data.Number as DN import Data.Number as DN
import Prelude
import Effect (Effect) import Effect (Effect)
import Effect.Debouncing as Debounce
import Prelude
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Toestand as T import Toestand as T
...@@ -25,20 +26,29 @@ import Gargantext.Utils.Reactix as R2 ...@@ -25,20 +26,29 @@ import Gargantext.Utils.Reactix as R2
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer.Toolbar.SlideButton" here = R2.here "Gargantext.Components.GraphExplorer.Toolbar.SlideButton"
defaultThrottleInterval :: Int
defaultThrottleInterval = 500
type Props = type Props =
( caption :: String ( caption :: String
, forceAtlasState :: T.Box SigmaxTypes.ForceAtlasState , forceAtlasState :: T.Box SigmaxTypes.ForceAtlasState
, min :: Number , min :: Number
, max :: Number , max :: Number
, onChange :: forall e. e -> Effect Unit , onChange :: Number -> Effect Unit
, state :: T.Box Number , state :: T.Box Number
, throttleInterval :: Maybe Int -- then Nothing, no throttling is done
) )
sizeButton :: Record Props -> R.Element sizeButton :: Record Props -> R.Element
sizeButton props = R.createElement sizeButtonCpt props [] sizeButton props = R.createElement sizeButtonCpt props []
sizeButtonCpt :: R.Component Props sizeButtonCpt :: R.Component Props
sizeButtonCpt = here.component "sizeButton" cpt where sizeButtonCpt = here.component "sizeButton" cpt where
cpt { state, caption, forceAtlasState, min, max, onChange } _ = do cpt { state, caption, forceAtlasState, min, max, onChange, throttleInterval } _ = do
let throttled = Debounce.throttleWithDebounceAtEnd onChange (fromMaybe 0 throttleInterval)
let onChangeThrottled = case throttleInterval of
Nothing -> onChange
Just ti -> \rng -> Debounce.call throttled rng
defaultValue <- T.useLive T.unequal state defaultValue <- T.useLive T.unequal state
forceAtlasState' <- R2.useLive' forceAtlasState forceAtlasState' <- R2.useLive' forceAtlasState
...@@ -61,7 +71,11 @@ sizeButtonCpt = here.component "sizeButton" cpt where ...@@ -61,7 +71,11 @@ sizeButtonCpt = here.component "sizeButton" cpt where
, min: show min , min: show min
, max: show max , max: show max
, defaultValue , defaultValue
, on: { input: onChange } , on: { input: \e -> do
let v = DN.fromString $ R.unsafeEventValue e
case v of
Nothing -> pure unit
Just vv -> onChangeThrottled vv }
, className: "range-simple__input" , className: "range-simple__input"
, disabled: status == Disabled , disabled: status == Disabled
} }
...@@ -92,12 +106,8 @@ labelSizeButtonCpt = here.component "labelSizeButton" cpt ...@@ -92,12 +106,8 @@ labelSizeButtonCpt = here.component "labelSizeButton" cpt
, forceAtlasState , forceAtlasState
, min: minLabelSize , min: minLabelSize
, max: maxLabelSize , max: maxLabelSize
, onChange: \e -> do , onChange: \newValue -> do
let sigma = R.readRef sigmaRef let sigma = R.readRef sigmaRef
let newValue' = DN.fromString $ R.unsafeEventValue e
case newValue' of
Nothing -> pure unit
Just newValue ->
Sigmax.dependOnSigma sigma "[labelSizeButton] sigma: Nothing" $ \s -> do Sigmax.dependOnSigma sigma "[labelSizeButton] sigma: Nothing" $ \s -> do
let ratio = (newValue - minLabelSize) / (defaultLabelSize - minLabelSize) let ratio = (newValue - minLabelSize) / (defaultLabelSize - minLabelSize)
let nodes = SigmaxTypes.graphNodes graph' let nodes = SigmaxTypes.graphNodes graph'
...@@ -116,6 +126,7 @@ labelSizeButtonCpt = here.component "labelSizeButton" cpt ...@@ -116,6 +126,7 @@ labelSizeButtonCpt = here.component "labelSizeButton" cpt
--, labelSizeRatio: newValue / 2.5 --, labelSizeRatio: newValue / 2.5
} }
T.write_ newValue state T.write_ newValue state
, throttleInterval: Just defaultThrottleInterval
} }
type LabelRenderedSizeThresholdButtonProps = type LabelRenderedSizeThresholdButtonProps =
...@@ -135,17 +146,14 @@ labelRenderedSizeThresholdButtonCpt = here.component "labelRenderedSizeThreshold ...@@ -135,17 +146,14 @@ labelRenderedSizeThresholdButtonCpt = here.component "labelRenderedSizeThreshold
, forceAtlasState , forceAtlasState
, min: 0.0 , min: 0.0
, max: 10.0 , max: 10.0
, onChange: \e -> do , onChange: \newValue -> do
let sigma = R.readRef sigmaRef let sigma = R.readRef sigmaRef
let newValue' = DN.fromString $ R.unsafeEventValue e
case newValue' of
Nothing -> pure unit
Just newValue ->
Sigmax.dependOnSigma sigma "[labelRenderdSizeThresholdButton] sigma: Nothing" $ \s -> do Sigmax.dependOnSigma sigma "[labelRenderdSizeThresholdButton] sigma: Nothing" $ \s -> do
Sigma.setSettings s { Sigma.setSettings s {
labelRenderedSizeThreshold: newValue labelRenderedSizeThreshold: newValue
} }
T.write_ newValue state T.write_ newValue state
, throttleInterval: Just defaultThrottleInterval
} }
type MouseSelectorSizeSliderProps = type MouseSelectorSizeSliderProps =
...@@ -164,16 +172,13 @@ mouseSelectorSizeSliderCpt = here.component "mouseSelectorSizeSlider" cpt ...@@ -164,16 +172,13 @@ mouseSelectorSizeSliderCpt = here.component "mouseSelectorSizeSlider" cpt
, forceAtlasState , forceAtlasState
, min: 1.0 , min: 1.0
, max: 100.0 , max: 100.0
, onChange: \e -> do , onChange: \newValue -> do
let sigma = R.readRef sigmaRef let sigma = R.readRef sigmaRef
let newValue' = DN.fromString $ R.unsafeEventValue e
case newValue' of
Nothing -> pure unit
Just newValue ->
Sigmax.dependOnSigma sigma "[mouseSelectorSizeButton] sigma: Nothing" $ \s -> do Sigmax.dependOnSigma sigma "[mouseSelectorSizeButton] sigma: Nothing" $ \s -> do
Sigma.setSettings s { Sigma.setSettings s {
mouseSelectorSize: newValue mouseSelectorSize: newValue
} }
T.write_ newValue state T.write_ newValue state
, state , state
, throttleInterval: Just defaultThrottleInterval
} }
...@@ -25,7 +25,6 @@ import Gargantext.Routes (AppRoute) ...@@ -25,7 +25,6 @@ import Gargantext.Routes (AppRoute)
import Gargantext.Sessions (Session(..)) import Gargantext.Sessions (Session(..))
import Gargantext.Types (NodeType) import Gargantext.Types (NodeType)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import GraphQL.Client.Args (type (==>))
import GraphQL.Client.BaseClients.Urql (UrqlClient, createClient) import GraphQL.Client.BaseClients.Urql (UrqlClient, createClient)
import GraphQL.Client.Query (decodeGqlRes) --, mutationJson) import GraphQL.Client.Query (decodeGqlRes) --, mutationJson)
import GraphQL.Client.SafeQueryName (safeQueryName) import GraphQL.Client.SafeQueryName (safeQueryName)
...@@ -146,27 +145,27 @@ mutationGql session name q = do ...@@ -146,27 +145,27 @@ mutationGql session name q = do
-- Schema -- Schema
type Schema type Schema
= { annuaire_contacts :: { contact_id :: Int } ==> Array AnnuaireContact = { annuaire_contacts :: { contact_id :: Int } -> Array AnnuaireContact
, context_ngrams :: { context_id :: Int, list_id :: Int } ==> Array String , context_ngrams :: { context_id :: Int, list_id :: Int } -> Array String
, contexts :: { context_id :: Int, node_id :: Int } ==> Array GQLCTX.NodeContext , contexts :: { context_id :: Int, node_id :: Int } -> Array GQLCTX.NodeContext
, contexts_for_ngrams :: { corpus_id :: Int, ngrams_terms :: Array String } ==> Array GQLCTX.Context , contexts_for_ngrams :: { corpus_id :: Int, ngrams_terms :: Array String } -> Array GQLCTX.Context
, imt_schools :: {} ==> Array GQLIMT.School , imt_schools :: {} -> Array GQLIMT.School
, languages :: {} ==> Array GQLNLP.Language , languages :: {} -> Array GQLNLP.Language
, node_children :: { node_id :: Int, child_type :: NodeType } ==> Array GQLNode.Node , node_children :: { node_id :: Int, child_type :: NodeType } -> Array GQLNode.Node
, node_parent :: { node_id :: Int, parent_type :: NodeType } ==> Array GQLNode.Node , node_parent :: { node_id :: Int, parent_type :: NodeType } -> Array GQLNode.Node
, nodes :: { node_id :: Int } ==> Array GQLNode.Node , nodes :: { node_id :: Int } -> Array GQLNode.Node
, nodes_corpus :: { corpus_id :: Int } ==> Array GQLNode.Corpus , nodes_corpus :: { corpus_id :: Int } -> Array GQLNode.Corpus
, user_infos :: { user_id :: Int } ==> Array UserInfo , user_infos :: { user_id :: Int } -> Array UserInfo
, users :: { user_id :: Int } ==> Array User , users :: { user_id :: Int } -> Array User
, team :: { team_node_id :: Int } ==> Team , team :: { team_node_id :: Int } -> Team
, tree :: { root_id :: Int } ==> TreeFirstLevel , tree :: { root_id :: Int } -> TreeFirstLevel
, tree_branch :: { node_id :: Int } ==> BreadcrumbInfo , tree_branch :: { node_id :: Int } -> BreadcrumbInfo
} }
type Mutation type Mutation
= { update_user_info :: UserInfoM ==> Int = { update_user_info :: UserInfoM -> Int
, update_user_pubmed_api_key :: UserPubmedAPIKeyM ==> Int , update_user_pubmed_api_key :: UserPubmedAPIKeyM -> Int
, update_user_epo_api_user :: UserEPOAPIUserM ==> Int , update_user_epo_api_user :: UserEPOAPIUserM -> Int
, update_user_epo_api_token :: UserEPOAPITokenM ==> Int , update_user_epo_api_token :: UserEPOAPITokenM -> Int
, delete_team_membership :: TeamDeleteM ==> Array Int , delete_team_membership :: TeamDeleteM -> Array Int
, update_node_context_category :: GQLCTX.NodeContextCategoryM ==> Array Int } , update_node_context_category :: GQLCTX.NodeContextCategoryM -> Array Int }
...@@ -44,7 +44,7 @@ getNode session nodeId = do ...@@ -44,7 +44,7 @@ getNode session nodeId = do
case eRes of case eRes of
Left err -> pure $ Left err Left err -> pure $ Left err
Right { nodes } -> do Right { nodes } -> do
liftEffect $ here.log2 "[getNode] node" nodes -- liftEffect $ here.log2 "[getNode] node" nodes
pure $ case A.head nodes of pure $ case A.head nodes of
Nothing -> Left (CustomError $ "node with id" <> show nodeId <>" not found") Nothing -> Left (CustomError $ "node with id" <> show nodeId <>" not found")
Just node -> Right node Just node -> Right node
...@@ -145,7 +145,7 @@ getTreeFirstLevel session id = do ...@@ -145,7 +145,7 @@ getTreeFirstLevel session id = do
case eRes of case eRes of
Left err -> pure $ Left err Left err -> pure $ Left err
Right { tree } -> do Right { tree } -> do
liftEffect $ here.log2 "[getTreeFirstLevel] tree first level" tree -- liftEffect $ here.log2 "[getTreeFirstLevel] tree first level" tree
pure $ Right tree -- TODO: error handling pure $ Right tree -- TODO: error handling
getTeam :: Session -> Int -> AffRESTError Team getTeam :: Session -> Int -> AffRESTError Team
......
...@@ -83,7 +83,6 @@ loginCpt = here.component "login" cpt where ...@@ -83,7 +83,6 @@ loginCpt = here.component "login" cpt where
-- | @link https://github.com/facebook/react/issues/12247 -- | @link https://github.com/facebook/react/issues/12247
loginContainer :: R2.Leaf Props loginContainer :: R2.Leaf Props
loginContainer = R2.leaf loginContainerCpt loginContainer = R2.leaf loginContainerCpt
loginContainerCpt :: R.Component Props loginContainerCpt :: R.Component Props
loginContainerCpt = here.component "container" cpt where loginContainerCpt = here.component "container" cpt where
cpt props@{ sessions, visible, loginRedirect } _ = do cpt props@{ sessions, visible, loginRedirect } _ = do
......
...@@ -5,7 +5,6 @@ module Gargantext.Components.Nodes.Graph ...@@ -5,7 +5,6 @@ module Gargantext.Components.Nodes.Graph
import Gargantext.Prelude import Gargantext.Prelude
import Data.Array as A import Data.Array as A
import Data.Int as I
import Data.Maybe (Maybe(..), isJust, maybe) import Data.Maybe (Maybe(..), isJust, maybe)
import Data.Sequence as Seq import Data.Sequence as Seq
import Data.Tuple (Tuple(..)) import Data.Tuple (Tuple(..))
...@@ -165,6 +164,11 @@ hydrateStoreCpt = here.component "hydrateStore" cpt where ...@@ -165,6 +164,11 @@ hydrateStoreCpt = here.component "hydrateStore" cpt where
-- | Precompute some values -- | Precompute some values
-- | -- |
let edgesWeightSorted = A.sortWith (_.weight) $ Seq.toUnfoldable $ SigmaxT.graphEdges graph
let edgeWeightMin = maybe 0.0 _.weight $ A.head edgesWeightSorted
let edgeWeightMax = maybe 100.0 _.weight $ A.last edgesWeightSorted
let edgeWeightRange = Range.Closed { min: edgeWeightMin, max: edgeWeightMax }
let edgesConfluenceSorted = A.sortWith (_.confluence) $ Seq.toUnfoldable $ SigmaxT.graphEdges graph let edgesConfluenceSorted = A.sortWith (_.confluence) $ Seq.toUnfoldable $ SigmaxT.graphEdges graph
let edgeConfluenceMin = maybe 0.0 _.confluence $ A.head edgesConfluenceSorted let edgeConfluenceMin = maybe 0.0 _.confluence $ A.head edgesConfluenceSorted
let edgeConfluenceMax = maybe 100.0 _.confluence $ A.last edgesConfluenceSorted let edgeConfluenceMax = maybe 100.0 _.confluence $ A.last edgesConfluenceSorted
...@@ -184,13 +188,17 @@ hydrateStoreCpt = here.component "hydrateStore" cpt where ...@@ -184,13 +188,17 @@ hydrateStoreCpt = here.component "hydrateStore" cpt where
let nodeSizeMax = maybe 100.0 _.size $ A.last nodesSorted let nodeSizeMax = maybe 100.0 _.size $ A.last nodesSorted
let nodeSizeRange = Range.Closed { min: nodeSizeMin, max: nodeSizeMax } let nodeSizeRange = Range.Closed { min: nodeSizeMin, max: nodeSizeMax }
let edgeWeight = Range.Closed -- let edgeWeight = Range.Closed
{ min: 0.0 -- { min: 0.0
, max: I.toNumber $ Seq.length $ SigmaxT.graphEdges graph -- , max: I.toNumber $ Seq.length $ SigmaxT.graphEdges graph
} -- }
-- let weightsSeq = Seq.map _.weight $ SigmaxT.graphEdges graph
-- let edgeWeight = Range.Closed
-- { min: fromMaybe 0.0 $ minimum weightsSeq
-- , max: fromMaybe 1.0 $ maximum weightsSeq } :: Range.Closed Number
let transformedGraph = transformGraph graph { edgeConfluence': GraphStore.options.edgeConfluence let transformedGraph = transformGraph graph { edgeConfluence': GraphStore.options.edgeConfluence
, edgeWeight': edgeWeight , edgeWeight': GraphStore.options.edgeWeight
, nodeSize': GraphStore.options.nodeSize , nodeSize': GraphStore.options.nodeSize
, removedNodeIds': GraphStore.options.removedNodeIds , removedNodeIds': GraphStore.options.removedNodeIds
, selectedNodeIds': GraphStore.options.selectedNodeIds , selectedNodeIds': GraphStore.options.selectedNodeIds
...@@ -208,7 +216,8 @@ hydrateStoreCpt = here.component "hydrateStore" cpt where ...@@ -208,7 +216,8 @@ hydrateStoreCpt = here.component "hydrateStore" cpt where
, startForceAtlas , startForceAtlas
, forceAtlasState , forceAtlasState
, noverlapState: SigmaxT.NoverlapPaused , noverlapState: SigmaxT.NoverlapPaused
, edgeWeight -- , edgeWeight
, edgeWeightRange
, edgeConfluenceRange , edgeConfluenceRange
, nodeSizeRange , nodeSizeRange
-- (cache options) -- (cache options)
......
...@@ -21,6 +21,7 @@ import DOM.Simple.Event as Event ...@@ -21,6 +21,7 @@ import DOM.Simple.Event as Event
import DOM.Simple.EventListener as EL import DOM.Simple.EventListener as EL
import DOM.Simple (DOMRect) import DOM.Simple (DOMRect)
import Effect (Effect) import Effect (Effect)
import Effect.Debouncing as Debounce
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
import Toestand as T import Toestand as T
...@@ -51,6 +52,7 @@ type Props = ...@@ -51,6 +52,7 @@ type Props =
, width :: Number , width :: Number
, height :: Number , height :: Number
, onChange :: Range.NumberRange -> Effect Unit , onChange :: Range.NumberRange -> Effect Unit
, throttleInterval :: Maybe Int -- then Nothing, no throttling is done
, status :: ComponentStatus ) , status :: ComponentStatus )
data Knob = MinKnob | MaxKnob data Knob = MinKnob | MaxKnob
...@@ -65,6 +67,11 @@ rangeSlider props = R.createElement rangeSliderCpt props [] ...@@ -65,6 +67,11 @@ rangeSlider props = R.createElement rangeSliderCpt props []
rangeSliderCpt :: R.Component Props rangeSliderCpt :: R.Component Props
rangeSliderCpt = here.component "rangeSlider" cpt where rangeSliderCpt = here.component "rangeSlider" cpt where
cpt props _ = do cpt props _ = do
let throttled = Debounce.throttleWithDebounceAtEnd props.onChange (fromMaybe 0 props.throttleInterval)
let onChangeThrottled = case props.throttleInterval of
Nothing -> props.onChange
Just ti -> \rng -> Debounce.call throttled rng
-- rounding precision (i.e. how many decimal digits are in epsilon) -- rounding precision (i.e. how many decimal digits are in epsilon)
let (Range.Closed { min: minR, max: maxR }) = props.initialValue let (Range.Closed { min: minR, max: maxR }) = props.initialValue
let decPrecision num = let decPrecision num =
...@@ -116,7 +123,8 @@ rangeSliderCpt = here.component "rangeSlider" cpt where ...@@ -116,7 +123,8 @@ rangeSliderCpt = here.component "rangeSlider" cpt where
case reproject drag scalePos props.bounds props.epsilon (R2.domMousePosition event) of case reproject drag scalePos props.bounds props.epsilon (R2.domMousePosition event) of
Just val -> do Just val -> do
setKnob knob value value' val setKnob knob value value' val
props.onChange $ knobSetter knob value' val -- props.onChange $ knobSetter knob value' val
onChangeThrottled $ knobSetter knob value' val
Nothing -> destroy unit Nothing -> destroy unit
let onMouseUp = EL.callback $ \(_event :: Event.MouseEvent) -> do let onMouseUp = EL.callback $ \(_event :: Event.MouseEvent) -> do
--props.onChange $ knobSetter knob value val --props.onChange $ knobSetter knob value val
......
...@@ -62,3 +62,12 @@ export function _scrollIntoView(el) { ...@@ -62,3 +62,12 @@ export function _scrollIntoView(el) {
}); });
} }
export const isPendingTransitionImpl = (t) => () => {
return t[0]();
}
export const startTransitionImpl = (t) => (f) => () => {
console.log('starting transition', t, f);
return t[1](() => { f()() });
}
...@@ -648,3 +648,24 @@ setInputValue elNullableRef val = case toMaybe (R.readRef elNullableRef) of ...@@ -648,3 +648,24 @@ setInputValue elNullableRef val = case toMaybe (R.readRef elNullableRef) of
_ <- pure $ (el .= "value") val _ <- pure $ (el .= "value") val
triggerEvent el "change" triggerEvent el "change"
triggerEvent el "input" triggerEvent el "input"
-- TODO useTransition?
foreign import data Transition :: Type
-- foreign import useTransitionImpl :: R.Hooks Transition
-- useTransition :: R.Hooks Transition
-- useTransition = useTransitionImpl
useTransition :: R.Hooks Transition
useTransition = hook $ \_ -> pure $ react ... "useTransition" $ []
foreign import isPendingTransitionImpl :: Transition -> R.Hooks Boolean
isPendingTransition :: Transition -> R.Hooks Boolean
isPendingTransition = isPendingTransitionImpl
foreign import startTransitionImpl :: Transition -> (Unit -> Effect Unit) -> Effect Unit
startTransition :: Transition -> (Unit -> Effect Unit) -> Effect Unit
startTransition = startTransitionImpl
...@@ -8,7 +8,7 @@ import Effect (Effect) ...@@ -8,7 +8,7 @@ import Effect (Effect)
import FFI.Simple ((...)) import FFI.Simple ((...))
import Gargantext.Components.App as App import Gargantext.Components.App as App
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Prelude (Unit, ($)) import Prelude (Unit, ($), bind)
import Reactix as R import Reactix as R
...@@ -21,6 +21,8 @@ main = paint $ toMaybe (document ... "getElementById" $ [ "app" ]) ...@@ -21,6 +21,8 @@ main = paint $ toMaybe (document ... "getElementById" $ [ "app" ])
paint :: Maybe Element -> Effect Unit paint :: Maybe Element -> Effect Unit
paint Nothing = here.error "[main] Container not found" paint Nothing = here.error "[main] Container not found"
paint (Just c) = do paint (Just c) = do
R.render app c -- R.render app c
let r = R.createRoot c
R.renderRoot r app
where where
app = App.app {} app = App.app {}
let conf = ./spago.dhall
in conf
// { sources = conf.sources # [ "test/**/*.purs" ]
, dependencies =
conf.dependencies # [ "spec", "spec-discovery", "spec-quickcheck" ]
}
...@@ -148,15 +148,17 @@ spec = do ...@@ -148,15 +148,17 @@ spec = do
cache = computeCache table $ Set.fromFoldable $ fst <$> tnres cache = computeCache table $ Set.fromFoldable $ fst <$> tnres
output = [ highlightNil " before " output = [ highlightNil " before "
, highlightSingleton " graph" ngramType CandidateTerm , highlightSingleton " graph" ngramType CandidateTerm
-- TODO Should it double the space after comma?
, highlightNil ", after " , highlightNil ", after "
] ]
highlightNgrams cache CTabTerms table input `shouldEqualArray` output highlightNgrams cache CTabTerms table input `shouldEqualArray` output
it "works for #598" do it "works for #598" do
let input = "Passant d’une conception quasi solipsiste ou monadique de la sensation, présente dans l’Essai sur les données immédiates de la conscience, à l’idée d’une sensibilité universelle mais impersonnelle dans Matière et mémoire, Bergson se heurte à plusieurs difficultés, dont celle d’une dissolution de la notion de Sujet. Dans L’évolution créatrice puis dans Les deux sources de la morale et de la religion, son approche évolutionniste lui permet d’envisager la perspective d’une sensibilité indéfiniment extensible, inséparable désormais de celle d’un Vivant par définition métastable qui va de l’amibe jusqu’à Dieu." let input = "Passant d’une conception quasi solipsiste ou monadique de la sensation, présente dans l’Essai sur les données immédiates de la conscience, à l’idée d’une sensibilité universelle mais impersonnelle dans Matière et mémoire, Bergson se heurte à plusieurs difficultés, dont celle d’une dissolution de la notion de Sujet. Dans L’évolution créatrice puis dans Les deux sources de la morale et de la religion, son approche évolutionniste lui permet d’envisager la perspective d’une sensibilité indéfiniment extensible, inséparable désormais de celle d’un Vivant par définition métastable qui va de l’amibe jusqu’à Dieu."
let startInput = " Passant d’une " -- TODO Space is present after "’", also double space after comma or dot.
let middleInput = " quasi solipsiste ou monadique de la sensation, présente dans l’Essai sur les données immédiates de la conscience, à l’idée d’une sensibilité universelle mais impersonnelle dans Matière et mémoire, Bergson se heurte à plusieurs difficultés, dont celle d’une dissolution de la " let startInput = " Passant d’ une "
let endInput = " de Sujet. Dans L’évolution créatrice puis dans Les deux sources de la morale et de la religion, son approche évolutionniste lui permet d’envisager la perspective d’une sensibilité indéfiniment extensible, inséparable désormais de celle d’un Vivant par définition métastable qui va de l’amibe jusqu’à Dieu. " let middleInput = " quasi solipsiste ou monadique de la sensation, présente dans l’ Essai sur les données immédiates de la conscience, à l’ idée d’ une sensibilité universelle mais impersonnelle dans Matière et mémoire, Bergson se heurte à plusieurs difficultés, dont celle d’ une dissolution de la "
let endInput = " de Sujet. Dans L’ évolution créatrice puis dans Les deux sources de la morale et de la religion, son approche évolutionniste lui permet d’ envisager la perspective d’ une sensibilité indéfiniment extensible, inséparable désormais de celle d’ un Vivant par définition métastable qui va de l’ amibe jusqu’ à Dieu. "
let ngramType = CTabSources let ngramType = CTabSources
-- let termsS = ["arbre","article","automate","automates","calcul","cas","classe","concept","conception","construction","difficultés","données","décidabilité","effet","ensemble","extension","familles","fois","graphes","généralisons","intérêt","langage","langages","logique","longueur inférieure","monadique","mots","notion","opérations","pensée","perception","perspective","point","premier ordre","problème","produit","produits","rendre compte","second ordre","structure","structures","thèse","théorie","théorème","travail","travaux","travers","univers","variétés","vue","étude","évaluation"] -- let termsS = ["arbre","article","automate","automates","calcul","cas","classe","concept","conception","construction","difficultés","données","décidabilité","effet","ensemble","extension","familles","fois","graphes","généralisons","intérêt","langage","langages","logique","longueur inférieure","monadique","mots","notion","opérations","pensée","perception","perspective","point","premier ordre","problème","produit","produits","rendre compte","second ordre","structure","structures","thèse","théorie","théorème","travail","travaux","travers","univers","variétés","vue","étude","évaluation"]
-- let contextNgramsS = ["concept","conception","difficultés","données","extension","monadique","Nothing" -- let contextNgramsS = ["concept","conception","difficultés","données","extension","monadique","Nothing"
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment