Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
a6983240
Commit
a6983240
authored
May 06, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[purescript] upgrade to 0.15, first draft
parent
9de858ae
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
557 additions
and
2634 deletions
+557
-2634
packages.json
.psc-package/local/.set/packages.json
+523
-2608
easy-ps.nix
nix/easy-ps.nix
+2
-2
packages.dhall
packages.dhall
+13
-5
shell.nix
shell.nix
+7
-4
spago.dhall
spago.dhall
+0
-1
Layout.purs
src/Gargantext/Components/GraphExplorer/Layout.purs
+2
-2
Sidebar.purs
src/Gargantext/Components/GraphExplorer/Sidebar/Sidebar.purs
+4
-4
DocList.purs
src/Gargantext/Components/PhyloExplorer/Sidebar/DocList.purs
+0
-1
RangeSlider.purs
src/Gargantext/Components/RangeSlider.purs
+2
-2
Array.purs
src/Gargantext/Utils/Array.purs
+1
-2
Math.purs
src/Gargantext/Utils/Math.purs
+3
-3
No files found.
.psc-package/local/.set/packages.json
View file @
a6983240
This source diff could not be displayed because it is too large. You can
view the blob
instead.
nix/easy-ps.nix
View file @
a6983240
...
...
@@ -5,8 +5,8 @@ import
pkgs
.
fetchFromGitHub
{
owner
=
"justinwoo"
;
repo
=
"easy-purescript-nix"
;
rev
=
"
9c5ffd3e54c41dece66ed84f8f23970a4f1f3883
"
;
sha256
=
"
8erFzbiRJYqPgJHuQwhgBPltQeaWeAZom/5X3lyUAcc
="
;
rev
=
"
0ad5775c1e80cdd952527db2da969982e39ff592
"
;
sha256
=
"
bwbpXSTD8Hf7tlCXfZuLfo2QivvX1ZDJ1PijXXRTo3Q
="
;
}
)
{
inherit
pkgs
;
...
...
packages.dhall
View file @
a6983240
let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.1
4.7-20220404/packages.dhall sha256:75d0f0719f32456e6bdc3efd41cfc64785655d2b751e3d080bd849033ed053f2
https://github.com/purescript/package-sets/releases/download/psc-0.1
5.0-20220506/packages.dhall sha256:f83b68ff07cf6557e82379e749118e6ff11eecc6be5754540aae855cd1e46917
let overrides =
{ globals =
...
...
@@ -110,15 +110,23 @@ let additions =
}
, ffi-simple =
{ dependencies =
[ "prelude"
[ "aff"
, "arrays"
, "effect"
, "
mayb
e"
, "
foldable-traversabl
e"
, "functions"
, "maybe"
, "nullable"
, "prelude"
, "psci-support"
, "refs"
, "spec"
, "tuples"
, "unsafe-coerce"
, "unsafe-reference"
]
, repo = "https://github.com/irresponsible/purescript-ffi-simple"
, version = "v0.
2.1
0"
, version = "v0.
3.
0"
}
, dom-simple =
{ dependencies =
...
...
@@ -221,7 +229,7 @@ let additions =
, version = "v2.2.0"
}
, uint =
{ dependencies = [ "maybe"
, "math"
]
{ dependencies = [ "maybe" ]
, repo = "https://github.com/zaquest/purescript-uint"
, version = "v5.1.1"
}
...
...
shell.nix
View file @
a6983240
...
...
@@ -20,10 +20,13 @@ let
echo "Compiling"
#build-purs
spago build
echo "Bundling"
#
spago build
#
echo "Bundling"
#pulp browserify --skip-compile -t dist/bundle.js --src-path output
browserify
#browserify
# 0.15
spago bundle-app --main Main --to dist/bundle.js
''
;
...
...
@@ -105,7 +108,7 @@ let
in
pkgs
.
mkShell
{
buildInputs
=
[
easy-ps
.
purs-0_1
4_7
easy-ps
.
purs-0_1
5_0
easy-ps
.
psc-package
easy-ps
.
dhall-json-simple
easy-ps
.
zephyr
...
...
spago.dhall
View file @
a6983240
...
...
@@ -49,7 +49,6 @@ to generate this file without the comments in this block.
, "lists"
, "markdown"
, "markdown-smolder"
, "math"
, "maybe"
, "media-types"
, "milkis"
...
...
src/Gargantext/Components/GraphExplorer/Layout.purs
View file @
a6983240
...
...
@@ -9,6 +9,7 @@ import Data.Int (toNumber)
import Data.Map as Map
import Data.Maybe (Maybe(..), fromJust)
import Data.Nullable (null, Nullable)
import Data.Number as DN
import Data.Sequence as Seq
import Data.Set as Set
import Data.Tuple (Tuple(..))
...
...
@@ -33,7 +34,6 @@ import Gargantext.Types as Types
import Gargantext.Utils ((?))
import Gargantext.Utils.Range as Range
import Gargantext.Utils.Reactix as R2
import Math as Math
import Partial.Unsafe (unsafePartial)
import Reactix as R
import Reactix.DOM.HTML as H
...
...
@@ -287,7 +287,7 @@ convert (GET.GraphData r) = Tuple r.metaData $ SigmaxT.Graph {nodes, edges}
, hidden : false
, id : n.id_
, label : n.label
, size :
Math
.log (toNumber n.size + 1.0)
, size :
DN
.log (toNumber n.size + 1.0)
, type : modeGraphType gargType
, x : n.x -- cos (toNumber i)
, y : n.y -- sin (toNumber i)
...
...
src/Gargantext/Components/GraphExplorer/Sidebar/Sidebar.purs
View file @
a6983240
...
...
@@ -13,6 +13,7 @@ import Data.Foldable as F
import Data.Int (fromString)
import Data.Map as Map
import Data.Maybe (Maybe(..), fromJust)
import Data.Number as DN
import Data.Sequence as Seq
import Data.Set as Set
import Data.Tuple.Nested ((/\))
...
...
@@ -38,7 +39,6 @@ import Gargantext.Types (CTabNgramType, FrontendError(..), NodeID, TabSubType(..
import Gargantext.Utils (nbsp)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
import Math as Math
import Partial.Unsafe (unsafePartial)
import Reactix as R
import Reactix.DOM.HTML as H
...
...
@@ -359,9 +359,9 @@ neighborhoodCpt = R.memo' $ here.component "neighborhood" cpt where
-- Computed
let
minSize = F.foldl
Math
.min 0.0 (Seq.map _.size (SigmaxT.graphNodes graph'))
minSize = F.foldl
DN
.min 0.0 (Seq.map _.size (SigmaxT.graphNodes graph'))
maxSize = F.foldl
Math
.max 0.0 (Seq.map _.size (SigmaxT.graphNodes graph'))
maxSize = F.foldl
DN
.max 0.0 (Seq.map _.size (SigmaxT.graphNodes graph'))
maxTruncateResult = 5
...
...
@@ -522,7 +522,7 @@ badgeSize minSize maxSize size =
minFontSize = 10.0
maxFontSize = 24.0
sizeScaled = (size - minSize) / (maxSize - minSize) -- in [0; 1] range
scale' =
Math.log (sizeScaled + 1.0) / (Math
.log 2.0) -- in [0; 1] range
scale' =
DN.log (sizeScaled + 1.0) / (DN
.log 2.0) -- in [0; 1] range
scale = minFontSize + scale' * (maxFontSize - minFontSize)
in
...
...
src/Gargantext/Components/PhyloExplorer/Sidebar/DocList.purs
View file @
a6983240
...
...
@@ -42,7 +42,6 @@ import Gargantext.Types (CTabNgramType, FrontendError(..), NodeID, TabSubType(..
import Gargantext.Utils (getter, nbsp)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
import Math as Math
import Partial.Unsafe (unsafePartial)
import Reactix as R
import Reactix.DOM.HTML as H
...
...
src/Gargantext/Components/RangeSlider.purs
View file @
a6983240
...
...
@@ -10,6 +10,7 @@ import Data.Generic.Rep (class Generic)
import Data.Eq.Generic (genericEq)
import Data.Int (fromNumber)
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Number as DN
import Data.Nullable (Nullable, null)
import Data.Traversable (traverse_)
import DOM.Simple as DOM
...
...
@@ -19,7 +20,6 @@ import DOM.Simple.EventListener as EL
import DOM.Simple (DOMRect)
import Global (toFixed)
import Effect (Effect)
import Math as M
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
...
...
@@ -65,7 +65,7 @@ rangeSliderCpt = here.component "rangeSlider" cpt
where
cpt props _ = do
-- rounding precision (i.e. how many decimal digits are in epsilon)
let precision = fromMaybe 0 $ fromNumber $ max 0.0 $ -
M.floor $ (M.log props.epsilon) / M
.ln10
let precision = fromMaybe 0 $ fromNumber $ max 0.0 $ -
DN.floor $ (DN.log props.epsilon) / DN
.ln10
-- scale bar
scaleElem <- (R.useRef null) :: R.Hooks (R.Ref (Nullable DOM.Element)) -- dom ref
...
...
src/Gargantext/Utils/Array.purs
View file @
a6983240
...
...
@@ -11,7 +11,6 @@ import Data.Maybe (Maybe(..))
import Data.Ord as Ord
import Effect (Effect)
import Effect.Uncurried (EffectFn2, runEffectFn2)
import Math as Math
import Gargantext.Prelude
...
...
@@ -37,4 +36,4 @@ min xs = foldr reducer (A.head xs) xs
range :: Int -> Int -> Int -> Array Int
range start end step = map (\i -> start + i*step) $ A.range 0 end'
where
end' = DI.round $
Math
.floor $ (DI.toNumber $ end - start) / (DI.toNumber step)
end' = DI.round $
DI
.floor $ (DI.toNumber $ end - start) / (DI.toNumber step)
src/Gargantext/Utils/Math.purs
View file @
a6983240
module Gargantext.Utils.Math where
import Data.Number as DN
import Prelude
import Math as Math
roundToMultiple :: Number -> Number -> Number
roundToMultiple eps num = eps *
Math
.round (num / eps)
roundToMultiple eps num = eps *
DN
.round (num / eps)
-- | Logarithm with given base
logb :: Number -> Number -> Number
logb base n = (
Math.log n) / (Math
.log base)
logb base n = (
DN.log n) / (DN
.log base)
log10 :: Number -> Number
log10 = logb 10.0
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