-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev-trash' into 'master'
Dev trash See merge request ebi-biows/jdispatcher-viewers!1
- Loading branch information
Showing
24 changed files
with
7,215 additions
and
6,690 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# https://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
insert_final_newline = false | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"semi": true, | ||
"bracketSpacing": true, | ||
"arrowParens": "avoid", | ||
"trailingComma": "es5", | ||
"bracketSameLine": true, | ||
"printWidth": 120 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// This will allow you to load `.json` files from disk | ||
declare module "*.json" { | ||
const value: any; | ||
export default value; | ||
declare module '*.json' { | ||
const value: any; | ||
export default value; | ||
} | ||
|
||
// This will allow you to load JSON from remote URL responses | ||
declare module "json!*" { | ||
const value: any; | ||
export default value; | ||
declare module 'json!*' { | ||
const value: any; | ||
export default value; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
import svgToMiniDataURI from "mini-svg-data-uri"; | ||
import {isBrowser, isNode} from "browser-or-node"; | ||
import {VisualOutput} from "./visual-output-app"; | ||
import {FunctionalPredictions} from "./functional-predictions-app"; | ||
import svgToMiniDataURI from 'mini-svg-data-uri'; | ||
import { isBrowser, isNode } from 'browser-or-node'; | ||
import { VisualOutput } from './visual-output-app'; | ||
import { FunctionalPredictions } from './functional-predictions-app'; | ||
import { | ||
validateJobId, | ||
fetchData, | ||
dataAsType, | ||
getJdispatcherJsonURL, | ||
validateSubmittedJobIdInput, | ||
validateSubmittedDbfetchInput, | ||
getIPRMCDataModelFlatFromXML, | ||
} from "./other-utilities"; | ||
import {ColorSchemeEnum} from "./custom-types"; | ||
validateJobId, | ||
fetchData, | ||
dataAsType, | ||
getJdispatcherJsonURL, | ||
validateSubmittedJobIdInput, | ||
validateSubmittedDbfetchInput, | ||
getIPRMCDataModelFlatFromXML, | ||
} from './other-utilities'; | ||
import { ColorSchemeEnum } from './custom-types'; | ||
|
||
// plugin support & module support | ||
// if (typeof window === "undefined") { | ||
if (isBrowser) { | ||
(window as any).VisualOutput = VisualOutput; | ||
(window as any).FunctionalPredictions = FunctionalPredictions; | ||
(window as any).validateJobId = validateJobId; | ||
(window as any).svgToMiniDataURI = svgToMiniDataURI; | ||
(window as any).fetchData = fetchData; | ||
(window as any).dataAsType = dataAsType; | ||
(window as any).getJdispatcherJsonURL = getJdispatcherJsonURL; | ||
(window as any).validateSubmittedJobIdInput = validateSubmittedJobIdInput; | ||
(window as any).validateSubmittedDbfetchInput = validateSubmittedDbfetchInput; | ||
(window as any).getIPRMCDataModelFlatFromXML = getIPRMCDataModelFlatFromXML; | ||
(window as any).ColorSchemeEnum = ColorSchemeEnum; | ||
(window as any).VisualOutput = VisualOutput; | ||
(window as any).FunctionalPredictions = FunctionalPredictions; | ||
(window as any).validateJobId = validateJobId; | ||
(window as any).svgToMiniDataURI = svgToMiniDataURI; | ||
(window as any).fetchData = fetchData; | ||
(window as any).dataAsType = dataAsType; | ||
(window as any).getJdispatcherJsonURL = getJdispatcherJsonURL; | ||
(window as any).validateSubmittedJobIdInput = validateSubmittedJobIdInput; | ||
(window as any).validateSubmittedDbfetchInput = validateSubmittedDbfetchInput; | ||
(window as any).getIPRMCDataModelFlatFromXML = getIPRMCDataModelFlatFromXML; | ||
(window as any).ColorSchemeEnum = ColorSchemeEnum; | ||
} | ||
if (isNode) { | ||
module.exports = { | ||
VisualOutput: VisualOutput, | ||
FunctionalPredictions: FunctionalPredictions, | ||
validateJobId: validateJobId, | ||
svgToMiniDataURI: svgToMiniDataURI, | ||
fetchData: fetchData, | ||
dataAsType: dataAsType, | ||
getJdispatcherJsonURL: getJdispatcherJsonURL, | ||
validateSubmittedJobIdInput: validateSubmittedJobIdInput, | ||
validateSubmittedDbfetchInput: validateSubmittedDbfetchInput, | ||
getIPRMCDataModelFlatFromXML: getIPRMCDataModelFlatFromXML, | ||
ColorSchemeEnum: ColorSchemeEnum, | ||
}; | ||
module.exports = { | ||
VisualOutput: VisualOutput, | ||
FunctionalPredictions: FunctionalPredictions, | ||
validateJobId: validateJobId, | ||
svgToMiniDataURI: svgToMiniDataURI, | ||
fetchData: fetchData, | ||
dataAsType: dataAsType, | ||
getJdispatcherJsonURL: getJdispatcherJsonURL, | ||
validateSubmittedJobIdInput: validateSubmittedJobIdInput, | ||
validateSubmittedDbfetchInput: validateSubmittedDbfetchInput, | ||
getIPRMCDataModelFlatFromXML: getIPRMCDataModelFlatFromXML, | ||
ColorSchemeEnum: ColorSchemeEnum, | ||
}; | ||
} | ||
|
||
// web-component support | ||
import "./visual-output-webcomponent.ts"; | ||
import "./functional-predictions-webcomponent.ts"; | ||
import './visual-output-webcomponent.ts'; | ||
import './functional-predictions-webcomponent.ts'; | ||
|
||
// demo index page with JobId input form (implemented in TypeScript) | ||
import "./index.ts"; | ||
import './index.ts'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,69 @@ | ||
import {fabric} from "fabric"; | ||
import {ColorType} from "./custom-types"; | ||
import { Gradient, FabricObject } from 'fabric'; | ||
import { ColorType } from './custom-types'; | ||
|
||
export const defaultGradient: ColorType = { | ||
0.0: [255, 64, 64], | ||
0.25: [255, 255, 64], | ||
0.5: [64, 255, 64], | ||
0.75: [64, 255, 255], | ||
1.0: [64, 64, 255], | ||
keys: [0.0, 0.25, 0.5, 0.75, 1.0], | ||
0.0: [255, 64, 64], | ||
0.25: [255, 255, 64], | ||
0.5: [64, 255, 64], | ||
0.75: [64, 255, 255], | ||
1.0: [64, 64, 255], | ||
keys: [0.0, 0.25, 0.5, 0.75, 1.0], | ||
}; | ||
|
||
export function colorDefaultGradient( | ||
canvasObj: fabric.Object, | ||
start: number, | ||
end: number | ||
) { | ||
canvasObj.set("fill", new fabric.Gradient({ | ||
type: "linear", | ||
coords: { | ||
x1: start, | ||
y1: 0, | ||
x2: end, | ||
y2: 0 | ||
}, | ||
colorStops: [ | ||
{offset: 0.0, color: `rgb(${defaultGradient[0.0].join(",")})`}, | ||
{offset: 0.25, color: `rgb(${defaultGradient[0.25].join(",")})`}, | ||
{offset: 0.5, color: `rgb(${defaultGradient[0.5].join(",")})`}, | ||
{offset: 0.75, color: `rgb(${defaultGradient[0.75].join(",")})`}, | ||
{offset: 1.0, color: `rgb(${defaultGradient[1.0].join(",")})`} | ||
] | ||
})); | ||
export function colorDefaultGradient(canvasObj: FabricObject, start: number, end: number) { | ||
canvasObj.set( | ||
'fill', | ||
new Gradient({ | ||
type: 'linear', | ||
coords: { | ||
x1: start, | ||
y1: 0, | ||
x2: end, | ||
y2: 0, | ||
}, | ||
colorStops: [ | ||
{ offset: 0.0, color: `rgb(${defaultGradient[0.0].join(',')})` }, | ||
{ offset: 0.25, color: `rgb(${defaultGradient[0.25].join(',')})` }, | ||
{ offset: 0.5, color: `rgb(${defaultGradient[0.5].join(',')})` }, | ||
{ offset: 0.75, color: `rgb(${defaultGradient[0.75].join(',')})` }, | ||
{ offset: 1.0, color: `rgb(${defaultGradient[1.0].join(',')})` }, | ||
], | ||
}) | ||
); | ||
} | ||
|
||
export const ncbiBlastGradient: ColorType = { | ||
0: [0, 0, 0], | ||
40: [0, 32, 233], | ||
50: [117, 234, 76], | ||
80: [219, 61, 233], | ||
200: [219, 51, 36], | ||
keys: [0, 40, 50, 80, 200], | ||
0: [0, 0, 0], | ||
40: [0, 32, 233], | ||
50: [117, 234, 76], | ||
80: [219, 61, 233], | ||
200: [219, 51, 36], | ||
keys: [0, 40, 50, 80, 200], | ||
}; | ||
|
||
export function colorNcbiBlastGradient( | ||
canvasObj: fabric.Object, | ||
start: number, | ||
end: number | ||
) { | ||
canvasObj.set("fill", new fabric.Gradient({ | ||
type: "linear", | ||
coords: { | ||
x1: start, | ||
y1: 0, | ||
x2: end, | ||
y2: 0 | ||
}, | ||
colorStops: [ | ||
{offset: 0.0, color: `rgb(${ncbiBlastGradient[0].join(",")})`}, | ||
{offset: 0.199999, color: `rgb(${ncbiBlastGradient[0].join(",")})`}, | ||
{offset: 0.2, color: `rgb(${ncbiBlastGradient[40].join(",")})`}, | ||
{offset: 0.399999, color: `rgb(${ncbiBlastGradient[40].join(",")})`}, | ||
{offset: 0.4, color: `rgb(${ncbiBlastGradient[50].join(",")})`}, | ||
{offset: 0.599999, color: `rgb(${ncbiBlastGradient[50].join(",")})`}, | ||
{offset: 0.6, color: `rgb(${ncbiBlastGradient[80].join(",")})`}, | ||
{offset: 0.799999, color: `rgb(${ncbiBlastGradient[80].join(",")})`}, | ||
{offset: 0.8, color: `rgb(${ncbiBlastGradient[200].join(",")})`}, | ||
{offset: 1.0, color: `rgb(${ncbiBlastGradient[200].join(",")})`}, | ||
] | ||
})); | ||
export function colorNcbiBlastGradient(canvasObj: FabricObject, start: number, end: number) { | ||
canvasObj.set( | ||
'fill', | ||
new Gradient({ | ||
type: 'linear', | ||
coords: { | ||
x1: start, | ||
y1: 0, | ||
x2: end, | ||
y2: 0, | ||
}, | ||
colorStops: [ | ||
{ offset: 0.0, color: `rgb(${ncbiBlastGradient[0].join(',')})` }, | ||
{ offset: 0.199999, color: `rgb(${ncbiBlastGradient[0].join(',')})` }, | ||
{ offset: 0.2, color: `rgb(${ncbiBlastGradient[40].join(',')})` }, | ||
{ offset: 0.399999, color: `rgb(${ncbiBlastGradient[40].join(',')})` }, | ||
{ offset: 0.4, color: `rgb(${ncbiBlastGradient[50].join(',')})` }, | ||
{ offset: 0.599999, color: `rgb(${ncbiBlastGradient[50].join(',')})` }, | ||
{ offset: 0.6, color: `rgb(${ncbiBlastGradient[80].join(',')})` }, | ||
{ offset: 0.799999, color: `rgb(${ncbiBlastGradient[80].join(',')})` }, | ||
{ offset: 0.8, color: `rgb(${ncbiBlastGradient[200].join(',')})` }, | ||
{ offset: 1.0, color: `rgb(${ncbiBlastGradient[200].join(',')})` }, | ||
], | ||
}) | ||
); | ||
} |
Oops, something went wrong.