...
 
Commits (15)
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5,8 +5,8 @@ import
pkgs.fetchFromGitHub {
owner = "justinwoo";
repo = "easy-purescript-nix";
rev = "9c5ffd3e54c41dece66ed84f8f23970a4f1f3883";
sha256 = "8erFzbiRJYqPgJHuQwhgBPltQeaWeAZom/5X3lyUAcc=";
rev = "cbcb53725c430de4e69f652d69c1677e17c6bcec";
sha256 = "K81AOJe2YmvJ8sSDZAL2Jw85Q9FvRQQCokxBpuNGrpQ=";
}
) {
inherit pkgs;
......
......@@ -212,7 +212,7 @@
name = "dom-simple";
version = "v0.2.7";
src = pkgs.fetchgit {
url = "https://github.com/irresponsible/purescript-dom-simple";
url = "https://github.com/garganscript/purescript-dom-simple";
rev = "v0.2.7";
sha256 = "02f1vsjk5frva3p3xpbrnj2zg4rg01l07dnvc3i6axvc5k30i282";
};
......@@ -266,7 +266,7 @@
name = "ffi-simple";
version = "v0.2.10";
src = pkgs.fetchgit {
url = "https://github.com/irresponsible/purescript-ffi-simple";
url = "https://github.com/garganscript/purescript-ffi-simple";
rev = "v0.2.10";
sha256 = "14slcccmy96ml7r8rzhhqnw486qj1b385i9095fdymms78g5gnj5";
};
......@@ -329,7 +329,7 @@
name = "formula";
version = "v0.2.1";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-formula";
url = "https://github.com/garganscript/purescript-formula";
rev = "v0.2.1";
sha256 = "0511r2n51sz59ksalzvrcbwwhbpj42h2dj2zknns7dnhkdkmf4a6";
};
......@@ -473,7 +473,7 @@
name = "markdown";
version = "2021-06-22";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-markdown";
url = "https://github.com/garganscript/purescript-markdown";
rev = "2021-06-22";
sha256 = "0crqn2mih21bwhhba9sm2g3lx5xla14qqz7mv04dpqf9ca998bbx";
};
......@@ -752,7 +752,7 @@
name = "reactix";
version = "v0.4.13";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-reactix";
url = "https://github.com/garganscript/purescript-reactix";
rev = "v0.4.13";
sha256 = "0b4hjwcw8y55p6iiyygzpw7c1jyh01nhmpszs7fnadjbg9x6d9d3";
};
......@@ -968,7 +968,7 @@
name = "toestand";
version = "v0.6.2";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-toestand";
url = "https://github.com/garganscript/purescript-toestand";
rev = "v0.6.2";
sha256 = "0wgav789ii14gsz0xc67nl5lc82sisdjd5wi6pwl5kj0i7ayz66y";
};
......@@ -995,7 +995,7 @@
name = "tuples-native";
version = "v2.2.0";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-tuples-native";
url = "https://github.com/garganscript/purescript-tuples-native";
rev = "v2.2.0";
sha256 = "0hplpqc2sbcjin084jqzhzqhprlc1achbqmsn9czpnf6ylgkqhaz";
};
......@@ -1031,7 +1031,7 @@
name = "typisch";
version = "v0.2.1";
src = pkgs.fetchgit {
url = "https://github.com/poorscript/purescript-typisch";
url = "https://github.com/garganscript/purescript-typisch";
rev = "v0.2.1";
sha256 = "1jccgfayh20qsmqgbh54knl4dwbwk3144mkzzv2pi07jprp8mzbf";
};
......
This diff is collapsed.
......@@ -636,7 +636,7 @@
"prelude",
"unsafe-coerce"
],
"repo": "https://github.com/irresponsible/purescript-dom-simple",
"repo": "https://github.com/garganscript/purescript-dom-simple",
"version": "v0.2.6"
},
"dotenv": {
......@@ -776,7 +776,7 @@
"nullable",
"unsafe-coerce"
],
"repo": "https://github.com/irresponsible/purescript-ffi-simple",
"repo": "https://github.com/garganscript/purescript-ffi-simple",
"version": "v0.2.4"
},
"filterable": {
......@@ -1468,7 +1468,7 @@
"dependencies": [
"precise"
],
"repo": "https://github.com/poorscript/purescript-markdown",
"repo": "https://github.com/garganscript/purescript-markdown",
"version": "2020-03-04"
},
"markdown-smolder": {
......@@ -1476,7 +1476,7 @@
"markdown",
"smolder"
],
"repo": "https://github.com/poorscript/purescript-markdown-smolder",
"repo": "https://github.com/garganscript/purescript-markdown-smolder",
"version": "2020-03-04"
},
"math": {
......@@ -2358,7 +2358,7 @@
"prelude",
"unsafe-coerce"
],
"repo": "https://github.com/irresponsible/purescript-reactix",
"repo": "https://github.com/garganscript/purescript-reactix",
"version": "v0.4.4"
},
"read": {
......
......@@ -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_14_7
easy-ps.purs-0_15_2
easy-ps.psc-package
easy-ps.dhall-json-simple
easy-ps.zephyr
......
......@@ -49,7 +49,6 @@ to generate this file without the comments in this block.
, "lists"
, "markdown"
, "markdown-smolder"
, "math"
, "maybe"
, "media-types"
, "milkis"
......@@ -76,9 +75,6 @@ to generate this file without the comments in this block.
, "simple-json-generics"
, "simplecrypto"
, "smolder"
, "spec"
, "spec-discovery"
, "spec-quickcheck"
, "strings"
, "strings-extra"
, "stringutils"
......@@ -102,5 +98,5 @@ to generate this file without the comments in this block.
, "web-xhr"
]
, packages = ./packages.dhall
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
, sources = [ "src/**/*.purs" ]
}
......@@ -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
......@@ -286,7 +286,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)
......
......@@ -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 ((/\))
......@@ -40,7 +41,6 @@ import Gargantext.Types (CTabNgramType, FrontendError(..), NodeID, TabSubType(..
import Gargantext.Utils (nbsp, setter, (?))
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
......@@ -416,9 +416,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
......@@ -606,7 +606,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
......
......@@ -27,6 +27,8 @@ import Gargantext.Routes as Routes
import Gargantext.Sessions (Session, sessionId)
import Gargantext.Utils (getter, (?))
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
import Partial.Unsafe (unsafePartial)
import React.SyntheticEvent as SE
import Reactix as R
import Reactix.DOM.HTML as H
......
......@@ -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
......
......@@ -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)
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
let conf = ./spago.dhall
in conf // {
sources = conf.sources # [ "test/**/*.purs" ],
dependencies = conf.dependencies # [ "spec"
, "spec-discovery"
, "spec-quickcheck" ]
}
......@@ -9028,9 +9028,9 @@ side-channel@^1.0.4:
get-intrinsic "^1.0.2"
object-inspect "^1.9.0"
"sigma@https://github.com/poorscript/sigma.js#garg":
"sigma@https://github.com/garganscript/sigma.js#garg":
version "1.2.1"
resolved "https://github.com/poorscript/sigma.js#624c611376dfb11cd34f1d01811d63dd5747ace7"
resolved "https://github.com/garganscript/sigma.js#624c611376dfb11cd34f1d01811d63dd5747ace7"
signal-exit@^3.0.0, signal-exit@^3.0.2:
version "3.0.3"
......