@sjcrh/proteinpaint-shared 2.140.1-1 → 2.142.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-shared",
3
- "version": "2.140.1-1",
3
+ "version": "2.142.0",
4
4
  "description": "ProteinPaint code that is shared between server and client-side workspaces",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/common.js CHANGED
@@ -1193,6 +1193,8 @@ export function kernelEpanechnikov(k) {
1193
1193
  }
1194
1194
  }
1195
1195
 
1196
+ /////////////////////// color sets /////////////////////////
1197
+
1196
1198
  export const schemeCategory20 = [
1197
1199
  '#1f77b4',
1198
1200
  '#aec7e8',
@@ -1233,6 +1235,25 @@ export function getColors(number) {
1233
1235
  return d3scale.scaleOrdinal(scheme)
1234
1236
  }
1235
1237
 
1238
+ // for now not using getColorScheme() for protein domains, because this color list have been in use since 2015...
1239
+ const proteinDomainColors = [
1240
+ '#8dd3c7',
1241
+ '#bebada',
1242
+ '#fb8072',
1243
+ '#80b1d3',
1244
+ '#E8E89E',
1245
+ '#a6d854',
1246
+ '#fdb462',
1247
+ '#ffd92f',
1248
+ '#e5c494',
1249
+ '#b3b3b3'
1250
+ ]
1251
+ export function proteinDomainColorScale() {
1252
+ return d3scale.scaleOrdinal().range(proteinDomainColors)
1253
+ }
1254
+
1255
+ /////////////////////// end of color sets /////////////////////////
1256
+
1236
1257
  export const truncatingMutations = ['F', 'N', 'L', 'P']
1237
1258
  export const proteinChangingMutations = ['F', 'N', 'L', 'P', 'D', 'I', 'ProteinAltering', 'M']
1238
1259
  export const synonymousMutations = ['S', 'Intron', 'Utr3', 'Utr5', 'noncoding', 'E']
@@ -53,6 +53,9 @@ export default function validate_bins(binconfig) {
53
53
  throw 'a custom last bin must not set a bin.stop value'
54
54
  }
55
55
  } else {
56
+ if (bin.startunbounded || bin.stopunbounded) {
57
+ throw 'bin.startunbounded and bin.stopunbounded must not be set for non-first/non-last bins'
58
+ }
56
59
  if (!isStrictNumeric(bin.start)) throw 'bin.start must be numeric for a non-first bin'
57
60
  if (!isStrictNumeric(bin.stop)) throw 'bin.stop must be numeric for a non-last bin'
58
61
  }