@niagads/common 0.2.2-alpha.64.sha-b63f7c25 → 0.2.2-alpha.64.sha-298ab6e7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/colors.js CHANGED
@@ -1,2 +1,2 @@
1
- const r={PuBlRd:["#601A4A","#EE442F","#63ACBE"],RdBlPu:["#EE442F","#601A4A","#63ACBE"],eight_color:["#332288","#117733","#44AA99","#88CCEE","#DDCC77","#CC6677","#AA4499","#882255"]},o=r=>{const o=String(r);let e;if(o.includes("e-")){const r=o.split("e-");parseInt(r[1])>50&&(e=50)}e||(e=-Math.log10(Number(r)));return{backgroundColor:t({thresholds:[.3,3,6,7.3,50],colors:["rgba(60,80,100,1)","rgb(254,220,220)","rgb(252,140,140)","rgb(255,200,120)","rgb(150,230,150)","rgb(150,210,255)"]})(e)}};function t({transform:r,thresholds:o,colors:t}){if(t.length!==o.length+1)throw new Error(`colorscale: colors array must have one more element than thresholds. Got ${o.length} thresholds and ${t.length} colors.`);return e=>{const l=r?r(e):e;for(let r=0;r<o.length;r++)if(l<o[r])return t[r];return t[t.length-1]}}export{r as COLOR_BLIND_FRIENDLY_PALETTES,t as colorscale,o as getPvalueStyle};
1
+ const r={PuBlRd:["#601A4A","#EE442F","#63ACBE"],RdBlPu:["#EE442F","#601A4A","#63ACBE"],eight_color:["#332288","#117733","#44AA99","#88CCEE","#DDCC77","#CC6677","#AA4499","#882255"]};function o({transform:r,thresholds:o,colors:t}){if(t.length!==o.length+1)throw new Error(`colorscale: colors array must have one more element than thresholds. Got ${o.length} thresholds and ${t.length} colors.`);return e=>{const l=r?r(e):e;for(let r=0;r<o.length;r++)if(l<o[r])return t[r];return t[t.length-1]}}export{r as COLOR_BLIND_FRIENDLY_PALETTES,o as colorscale};
2
2
  //# sourceMappingURL=colors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"colors.js","sources":["../src/colors.tsx"],"sourcesContent":[null],"names":["COLOR_BLIND_FRIENDLY_PALETTES","PuBlRd","RdBlPu","eight_color","getPvalueStyle","pvalue","strValue","String","neglog10p","includes","parts","split","parseInt","Math","log10","Number","backgroundColor","colorscale","thresholds","colors","scale","transform","length","Error","value","transformedValue","i"],"mappings":"AAAO,MAAMA,EAAgC,CACzCC,OAAQ,CAAC,UAAW,UAAW,WAC/BC,OAAQ,CAAC,UAAW,UAAW,WAC/BC,YAAa,CAAC,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,YAclFC,EAAkBC,IAC3B,MAAMC,EAAWC,OAAOF,GACxB,IAAIG,EACJ,GAAIF,EAASG,SAAS,MAAO,CACzB,MAAMC,EAAQJ,EAASK,MAAM,MACZC,SAASF,EAAM,IACjB,KACXF,EAAY,GAEpB,CACKA,IACDA,GAAaK,KAAKC,MAAMC,OAAOV,KAenC,MAAO,CAAEW,gBAbKC,EAAW,CACrBC,WAAY,CAAC,GAAK,EAAG,EAAG,IAAK,IAC7BC,OAAQ,CACJ,oBACA,mBACA,mBACA,mBACA,mBACA,qBAGeC,CAAMZ,KA2C3B,SAAUS,GAAWI,UACvBA,EAASH,WACTA,EAAUC,OACVA,IAMA,GAAIA,EAAOG,SAAWJ,EAAWI,OAAS,EACtC,MAAM,IAAIC,MAEF,4EAAOL,EAAWI,yBAAyBH,EAAOG,kBAI9D,OAAQE,IACJ,MAAMC,EAAmBJ,EAAYA,EAAUG,GAASA,EACxD,IAAK,IAAIE,EAAI,EAAGA,EAAIR,EAAWI,OAAQI,IACnC,GAAID,EAAmBP,EAAWQ,GAC9B,OAAOP,EAAOO,GAGtB,OAAOP,EAAOA,EAAOG,OAAS,GAEtC"}
1
+ {"version":3,"file":"colors.js","sources":["../src/colors.tsx"],"sourcesContent":[null],"names":["COLOR_BLIND_FRIENDLY_PALETTES","PuBlRd","RdBlPu","eight_color","colorscale","transform","thresholds","colors","length","Error","value","transformedValue","i"],"mappings":"AAAO,MAAMA,EAAgC,CACzCC,OAAQ,CAAC,UAAW,UAAW,WAC/BC,OAAQ,CAAC,UAAW,UAAW,WAC/BC,YAAa,CAAC,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,YAmDzF,SAAUC,GAAWC,UACvBA,EAASC,WACTA,EAAUC,OACVA,IAMA,GAAIA,EAAOC,SAAWF,EAAWE,OAAS,EACtC,MAAM,IAAIC,MAEF,4EAAOH,EAAWE,yBAAyBD,EAAOC,kBAI9D,OAAQE,IACJ,MAAMC,EAAmBN,EAAYA,EAAUK,GAASA,EACxD,IAAK,IAAIE,EAAI,EAAGA,EAAIN,EAAWE,OAAQI,IACnC,GAAID,EAAmBL,EAAWM,GAC9B,OAAOL,EAAOK,GAGtB,OAAOL,EAAOA,EAAOC,OAAS,GAEtC"}
package/dist/index.d.ts CHANGED
@@ -13,9 +13,6 @@ type HEX = `#${string}`;
13
13
  type STANDARD_COLORS = "red" | "blue" | "green" | "gold" | "grey" | "black" | "white";
14
14
  type Color = RGB | RGBA | HSL | HEX | STANDARD_COLORS;
15
15
  type ColorScale = (value: number) => Color;
16
- declare const getPvalueStyle: (pvalue: number | string) => {
17
- backgroundColor: Color;
18
- };
19
16
  declare function colorscale({ transform, thresholds, colors, }: {
20
17
  transform?: (value: number) => number;
21
18
  thresholds: readonly number[];
@@ -104,5 +101,5 @@ declare function LoadingProvider({ children }: {
104
101
  }): React.JSX.Element;
105
102
  declare function useLoading(): LoadingContextType;
106
103
 
107
- export { APIError, COLOR_BLIND_FRIENDLY_PALETTES, LoadingProvider, _deepCopy, _get, _hasOwnProperty, _isEmpty, _isJSON, _isNA, _isNull, _isObject, backendFetch, backendFetchFromRequest, caseInsensitiveIncludes, colorscale, formatMultiline, getPvalueStyle, getUrlParam, isAPIError, jsonSyntaxHighlight, linkify, negLog10, safeHtml, toExponential, toFixedWithoutZeros, toTitleCase, useLoading, userAgentIsBrowser };
104
+ export { APIError, COLOR_BLIND_FRIENDLY_PALETTES, LoadingProvider, _deepCopy, _get, _hasOwnProperty, _isEmpty, _isJSON, _isNA, _isNull, _isObject, backendFetch, backendFetchFromRequest, caseInsensitiveIncludes, colorscale, formatMultiline, getUrlParam, isAPIError, jsonSyntaxHighlight, linkify, negLog10, safeHtml, toExponential, toFixedWithoutZeros, toTitleCase, useLoading, userAgentIsBrowser };
108
105
  export type { APIErrorResponse, APIPagination, APIResponse, APIResult, BasicType, Color, ColorScale, Expand, ExpandRecursively, Modify, NAString, Range, TypeMapper };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export{COLOR_BLIND_FRIENDLY_PALETTES,colorscale,getPvalueStyle}from"./colors.js";export{APIError,isAPIError}from"./errors.js";export{safeHtml}from"./formatters.js";export{_deepCopy,_get,_hasOwnProperty,_isEmpty,_isJSON,_isNA,_isNull,_isObject,caseInsensitiveIncludes,formatMultiline,getUrlParam,jsonSyntaxHighlight,linkify,negLog10,toExponential,toFixedWithoutZeros,toTitleCase}from"./utils.js";export{backendFetch,backendFetchFromRequest,userAgentIsBrowser}from"./route-handlers.js";export{LoadingProvider,useLoading}from"./components/providers/LoadingProvider.js";
1
+ export{COLOR_BLIND_FRIENDLY_PALETTES,colorscale}from"./colors.js";export{APIError,isAPIError}from"./errors.js";export{safeHtml}from"./formatters.js";export{_deepCopy,_get,_hasOwnProperty,_isEmpty,_isJSON,_isNA,_isNull,_isObject,caseInsensitiveIncludes,formatMultiline,getUrlParam,jsonSyntaxHighlight,linkify,negLog10,toExponential,toFixedWithoutZeros,toTitleCase}from"./utils.js";export{backendFetch,backendFetchFromRequest,userAgentIsBrowser}from"./route-handlers.js";export{LoadingProvider,useLoading}from"./components/providers/LoadingProvider.js";
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@niagads/common",
3
- "version": "0.2.2-alpha.64.sha-b63f7c25",
3
+ "version": "0.2.2-alpha.64.sha-298ab6e7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/NIAGADS/niagads-viz-monorepo.git"
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "b63f7c252fc12b430e30783e784629691b1797ca"
47
+ "gitHead": "298ab6e725b3547361304372eea54d605feb8700"
48
48
  }