Skip to content

Commit

Permalink
Update installation
Browse files Browse the repository at this point in the history
  • Loading branch information
nvelden committed Jan 13, 2025
1 parent e8d6b3f commit 7c15367
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 139 deletions.
160 changes: 82 additions & 78 deletions docs/articles/geneviewer.html

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/articles/geneviewer_files/D3-7.8.5/geneviewer.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
dependencies:
- name: geneviewerwidget
version: 0.1.10
version: 0.1.8
src: htmlwidgets
script: geneviewerwidget.js
- name: Themes
version: 0.1.10
version: 0.1.8
src: htmlwidgets
script: ./lib/geneviewer-0.1.10/Themes.js
script: ./lib/geneviewer-0.1.8/Themes.js
- name: geneviewer
version: 0.1.10
version: 0.1.8
src: htmlwidgets
script: ./lib/geneviewer-0.1.10/geneviewer.js
script: ./lib/geneviewer-0.1.8/geneviewer.js
- name: D3
version: 7.8.5
src: htmlwidgets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ function mergeOptions(defaultOptions, themeOptionsKey, userOptions) {
function getColorScale(colorScheme, customColors, uniqueGroups) {
let colorScale;

//customColors = { ...(customColors || {}), null: "#FFF" };

const schemeCategory30 = [
"#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd",
"#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf",
Expand All @@ -360,18 +362,9 @@ function getColorScale(colorScheme, customColors, uniqueGroups) {
"#8c6d31", "#e7cb94", "#e7969c", "#7b4173", "#a55194"
];

if (customColors && typeof customColors === "string") {
// Handle customColors as a single color
colorScale = d3.scaleOrdinal()
.domain(uniqueGroups)
.range(uniqueGroups.map(() => customColors));
} else if (customColors && Array.isArray(customColors)) {
// Handle customColors as an array
colorScale = d3.scaleOrdinal()
.domain(uniqueGroups)
.range(uniqueGroups.map((group, index) => customColors[index % customColors.length] || "#FFF"));
} else if (customColors && typeof customColors === 'object') {
// Handle customColors as an object
// Check if customColors is an object and not an array
if (customColors && typeof customColors === 'object' && !Array.isArray(customColors)) {
// Create a color scale based on the customColors object
colorScale = d3.scaleOrdinal()
.domain(uniqueGroups)
.range(uniqueGroups.map(group => customColors[group] || "#FFF"));
Expand All @@ -388,18 +381,15 @@ function getColorScale(colorScheme, customColors, uniqueGroups) {
}
}
} else {
// Default to schemeCategory30
colorScale = d3.scaleOrdinal(schemeCategory30)
.domain(uniqueGroups)
.range(uniqueGroups.map(group =>
group === "No Hit" || group === null ? "#FFF" : schemeCategory30[uniqueGroups.indexOf(group) % schemeCategory30.length]
));
}

return colorScale;
}


function isInAnyDiscontinuity(value, breaks) {
for (let gap of breaks) {
if (value >= gap.start && value <= gap.end) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
dependencies:
- name: geneviewerwidget
version: 0.1.10
version: 0.1.8
src: htmlwidgets
script: geneviewerwidget.js
- name: Themes
version: 0.1.10
version: 0.1.8
src: htmlwidgets
script: ./lib/geneviewer-0.1.10/Themes.js
script: ./lib/geneviewer-0.1.8/Themes.js
- name: geneviewer
version: 0.1.10
version: 0.1.8
src: htmlwidgets
script: ./lib/geneviewer-0.1.10/geneviewer.js
script: ./lib/geneviewer-0.1.8/geneviewer.js
- name: D3
version: 7.8.5
src: htmlwidgets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ function mergeOptions(defaultOptions, themeOptionsKey, userOptions) {
function getColorScale(colorScheme, customColors, uniqueGroups) {
let colorScale;

//customColors = { ...(customColors || {}), null: "#FFF" };

const schemeCategory30 = [
"#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd",
"#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf",
Expand All @@ -360,18 +362,9 @@ function getColorScale(colorScheme, customColors, uniqueGroups) {
"#8c6d31", "#e7cb94", "#e7969c", "#7b4173", "#a55194"
];

if (customColors && typeof customColors === "string") {
// Handle customColors as a single color
colorScale = d3.scaleOrdinal()
.domain(uniqueGroups)
.range(uniqueGroups.map(() => customColors));
} else if (customColors && Array.isArray(customColors)) {
// Handle customColors as an array
colorScale = d3.scaleOrdinal()
.domain(uniqueGroups)
.range(uniqueGroups.map((group, index) => customColors[index % customColors.length] || "#FFF"));
} else if (customColors && typeof customColors === 'object') {
// Handle customColors as an object
// Check if customColors is an object and not an array
if (customColors && typeof customColors === 'object' && !Array.isArray(customColors)) {
// Create a color scale based on the customColors object
colorScale = d3.scaleOrdinal()
.domain(uniqueGroups)
.range(uniqueGroups.map(group => customColors[group] || "#FFF"));
Expand All @@ -388,18 +381,15 @@ function getColorScale(colorScheme, customColors, uniqueGroups) {
}
}
} else {
// Default to schemeCategory30
colorScale = d3.scaleOrdinal(schemeCategory30)
.domain(uniqueGroups)
.range(uniqueGroups.map(group =>
group === "No Hit" || group === null ? "#FFF" : schemeCategory30[uniqueGroups.indexOf(group) % schemeCategory30.length]
));
}

return colorScale;
}


function isInAnyDiscontinuity(value, breaks) {
for (let gap of breaks) {
if (value >= gap.start && value <= gap.end) {
Expand Down
10 changes: 5 additions & 5 deletions docs/articles/geneviewer_files/html2canvas-1.4.1/geneviewer.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
dependencies:
- name: geneviewerwidget
version: 0.1.10
version: 0.1.8
src: htmlwidgets
script: geneviewerwidget.js
- name: Themes
version: 0.1.10
version: 0.1.8
src: htmlwidgets
script: ./lib/geneviewer-0.1.10/Themes.js
script: ./lib/geneviewer-0.1.8/Themes.js
- name: geneviewer
version: 0.1.10
version: 0.1.8
src: htmlwidgets
script: ./lib/geneviewer-0.1.10/geneviewer.js
script: ./lib/geneviewer-0.1.8/geneviewer.js
- name: D3
version: 7.8.5
src: htmlwidgets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ function mergeOptions(defaultOptions, themeOptionsKey, userOptions) {
function getColorScale(colorScheme, customColors, uniqueGroups) {
let colorScale;

//customColors = { ...(customColors || {}), null: "#FFF" };

const schemeCategory30 = [
"#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd",
"#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf",
Expand All @@ -360,18 +362,9 @@ function getColorScale(colorScheme, customColors, uniqueGroups) {
"#8c6d31", "#e7cb94", "#e7969c", "#7b4173", "#a55194"
];

if (customColors && typeof customColors === "string") {
// Handle customColors as a single color
colorScale = d3.scaleOrdinal()
.domain(uniqueGroups)
.range(uniqueGroups.map(() => customColors));
} else if (customColors && Array.isArray(customColors)) {
// Handle customColors as an array
colorScale = d3.scaleOrdinal()
.domain(uniqueGroups)
.range(uniqueGroups.map((group, index) => customColors[index % customColors.length] || "#FFF"));
} else if (customColors && typeof customColors === 'object') {
// Handle customColors as an object
// Check if customColors is an object and not an array
if (customColors && typeof customColors === 'object' && !Array.isArray(customColors)) {
// Create a color scale based on the customColors object
colorScale = d3.scaleOrdinal()
.domain(uniqueGroups)
.range(uniqueGroups.map(group => customColors[group] || "#FFF"));
Expand All @@ -388,18 +381,15 @@ function getColorScale(colorScheme, customColors, uniqueGroups) {
}
}
} else {
// Default to schemeCategory30
colorScale = d3.scaleOrdinal(schemeCategory30)
.domain(uniqueGroups)
.range(uniqueGroups.map(group =>
group === "No Hit" || group === null ? "#FFF" : schemeCategory30[uniqueGroups.indexOf(group) % schemeCategory30.length]
));
}

return colorScale;
}


function isInAnyDiscontinuity(value, breaks) {
for (let gap of breaks) {
if (value >= gap.start && value <= gap.end) {
Expand Down
8 changes: 7 additions & 1 deletion vignettes/geneviewer.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ knitr::opts_chunk$set(

## Installation

**geneviewer** is available through GitHub
You can install the released version of **geneviewer** from CRAN with:

```r
install.packages("geneviewer")
```

And the development version from GitHub with:

``` r
# install.packages("devtools")
Expand Down

0 comments on commit 7c15367

Please sign in to comment.