text:
R CMD check passed

Zuguang Gu authored on 20/09/2018 12:48:08
Showing1 changed files
 1 1 deleted file mode 100755 ... ... @@ -1,57 +0,0 @@ 1 -\name{plotDataFrame} 2 -\alias{plotDataFrame} 3 -\title{ 4 -Quickly visualize a data frame 5 -} 6 -\description{ 7 -Quickly visualize a data frame 8 -} 9 -\usage{ 10 -plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, 11 - show_column_names = TRUE, group = NULL, group_names = names(group), 12 - main_heatmap = NULL, km = 1, split = NULL, cluster_rows = TRUE, 13 - cluster_columns = TRUE, row_order = NULL, ...) 14 -} 15 -\arguments{ 16 - 17 - \item{df}{a data frame.} 18 - \item{overlap}{how to group numeric columns. If the overlapping rate between the ranges in the current column and previous numeric column is larger than this value, the two columns are treated as under same measurement and should be grouped.} 19 - \item{nlevel}{If the number of levels of a character column is larger than this value, the column will be excluded, because it doesn't make any sense to visualize a character vector or matrix that contains huge number of unique elements through a heatmap.} 20 - \item{show_row_names}{whether show row names after the last heatmap if there are row names.} 21 - \item{show_column_names}{whether show column names for all heatmaps.} 22 - \item{group}{a list of index that defines the groupping.} 23 - \item{group_names}{names for each group.} 24 - \item{main_heatmap}{which group is the main heatmap?} 25 - \item{km}{a value larger than 1 means applying k-means clustering on rows for the main heatmap.} 26 - \item{split}{one or multiple variables that split the rows.} 27 - \item{cluster_rows}{whether perform clustering on rows of the main heatmap.} 28 - \item{cluster_columns}{whether perform clustering on columns for all heatmaps.} 29 - \item{row_order}{order of rows, remember to turn off \code{cluster_rows}} 30 - \item{...}{pass to \code{\link{draw,HeatmapList-method}} or \code{\link{make_layout,HeatmapList-method}}} 31 - 32 -} 33 -\details{ 34 -The data frame contains heterogeneous information. The \code{\link{plotDataFrame}} function provides a simple and quick way to 35 -visualize information that are stored in a data frame. 36 - 37 -There are only a few settings in this function, so the heamtap generated by this functioin 38 -may look ugly (in most of the time). However, users can customize the style of the heatmaps by manually 39 -constructing a \code{\link{HeatmapList}} object. 40 -} 41 -\value{ 42 -A \code{\link{HeatmapList}} object. 43 -} 44 -\author{ 45 -Zuguang Gu  46 -} 47 -\examples{ 48 -df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 49 - large = runif(10)*100, 50 - t1 = sample(letters[1:3], 10, replace = TRUE), 51 - matrix(runif(60), nrow = 10, dimnames = list(LETTERS[1:10], LETTERS[1:6])), 52 - t2 = sample(LETTERS[1:3], 10, replace = TRUE)) 53 -plotDataFrame(df) 54 -plotDataFrame(df, group = list(1:4, 5, 6, 7:12, 13), group_names = c("mat1", "large", "t1", "mat2", "t2"), 55 - main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title") 56 - 57 -}

Merge branch 'master' into devel

z.gu authored on 12/11/2015 10:07:49
Showing1 changed files
 ... ... @@ -10,13 +10,13 @@ Quickly visualize a data frame 10 10  plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, 11 11  show_column_names = TRUE, group = NULL, group_names = names(group), 12 12  main_heatmap = NULL, km = 1, split = NULL, cluster_rows = TRUE, 13 - cluster_columns = TRUE, ...) 13 + cluster_columns = TRUE, row_order = NULL, ...) 14 14  } 15 15  \arguments{ 16 16   17 17  \item{df}{a data frame.} 18 - \item{overlap}{how to group numeric columns. If the overlapping rate between the ranges in thecurrent column and previous numeric column is larger than this value, the two columnsare treated as under same measurement and should be grouped.} 19 - \item{nlevel}{If the number of levels of a character column is larger than this value, the column willbe excluded, because it doesn't make any sense to visualize a character vector or matrixthat contains huge number of unique elements through a heatmap.} 18 + \item{overlap}{how to group numeric columns. If the overlapping rate between the ranges in the current column and previous numeric column is larger than this value, the two columns are treated as under same measurement and should be grouped.} 19 + \item{nlevel}{If the number of levels of a character column is larger than this value, the column will be excluded, because it doesn't make any sense to visualize a character vector or matrix that contains huge number of unique elements through a heatmap.} 20 20  \item{show_row_names}{whether show row names after the last heatmap if there are row names.} 21 21  \item{show_column_names}{whether show column names for all heatmaps.} 22 22  \item{group}{a list of index that defines the groupping.} ... ... @@ -26,6 +26,7 @@ plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, 26 26  \item{split}{one or multiple variables that split the rows.} 27 27  \item{cluster_rows}{whether perform clustering on rows of the main heatmap.} 28 28  \item{cluster_columns}{whether perform clustering on columns for all heatmaps.} 29 + \item{row_order}{order of rows, remember to turn off \code{cluster_rows}} 29 30  \item{...}{pass to \code{\link{draw,HeatmapList-method}} or \code{\link{make_layout,HeatmapList-method}}} 30 31   31 32  }

Merge branch 'master' into devel

z.gu authored on 07/09/2015 20:39:32
Showing1 changed files
 1 1 old mode 100644 2 2 new mode 100755

resolve conflict from master branch

z.gu authored on 03/09/2015 20:32:44
Showing1 changed files
 ... ... @@ -33,12 +33,12 @@ plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, 33 33  The data frame contains heterogeneous information. The \code{\link{plotDataFrame}} function provides a simple and quick way to 34 34  visualize information that are stored in a data frame. 35 35   36 -There are only a few advanced settings in this function, so the heamtap generated by this functioin 36 +There are only a few settings in this function, so the heamtap generated by this functioin 37 37  may look ugly (in most of the time). However, users can customize the style of the heatmaps by manually 38 38  constructing a \code{\link{HeatmapList}} object. 39 39  } 40 40  \value{ 41 -a \code{\link{HeatmapList}} object. 41 +A \code{\link{HeatmapList}} object. 42 42  } 43 43  \author{ 44 44  Zuguang Gu

Commit made by the Bioconductor Git-SVN bridge.

Commit id: db263179df8a28bd25eb5afcf64aa9c37b2fdd32

refresh docs

z.gu authored on 12/08/2015 22:49:59
Showing1 changed files
 ... ... @@ -32,6 +32,7 @@ plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, 32 32  \details{ 33 33  The data frame contains heterogeneous information. The \code{\link{plotDataFrame}} function provides a simple and quick way to 34 34  visualize information that are stored in a data frame. 35 + 35 36  There are only a few advanced settings in this function, so the heamtap generated by this functioin 36 37  may look ugly (in most of the time). However, users can customize the style of the heatmaps by manually 37 38  constructing a \code{\link{HeatmapList}} object.

Commit made by the Bioconductor Git-SVN bridge.

Commit id: 1de356e1d1343725223e03ff696f931d80b2842b

Merge branch 'master' of https://github.com/jokergoo/mheatmap

Commit id: 478962957a34b7a5e87c8336989bae3df54f9559

change default colors

z.gu authored on 12/08/2015 22:03:22
Showing1 changed files
 ... ... @@ -10,7 +10,8 @@ Quickly visualize a data frame 10 10  plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, 11 11  show_column_names = TRUE, group = NULL, group_names = names(group), 12 12  main_heatmap = NULL, km = 1, split = NULL, cluster_rows = TRUE, 13 - cluster_columns = TRUE, ...)} 13 + cluster_columns = TRUE, ...) 14 +} 14 15  \arguments{ 15 16   16 17  \item{df}{a data frame.} ... ... @@ -26,6 +27,7 @@ plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, 26 27  \item{cluster_rows}{whether perform clustering on rows of the main heatmap.} 27 28  \item{cluster_columns}{whether perform clustering on columns for all heatmaps.} 28 29  \item{...}{pass to \code{\link{draw,HeatmapList-method}} or \code{\link{make_layout,HeatmapList-method}}} 30 + 29 31  } 30 32  \details{ 31 33  The data frame contains heterogeneous information. The \code{\link{plotDataFrame}} function provides a simple and quick way to ... ... @@ -49,4 +51,5 @@ df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], lett 49 51  plotDataFrame(df) 50 52  plotDataFrame(df, group = list(1:4, 5, 6, 7:12, 13), group_names = c("mat1", "large", "t1", "mat2", "t2"), 51 53  main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title") 54 + 52 55  }

Commit made by the Bioconductor Git-SVN bridge.

refreshed documentations

z.gu authored on 11/08/2015 10:42:08
Showing1 changed files
 ... ... @@ -2,11 +2,9 @@ 2 2  \alias{plotDataFrame} 3 3  \title{ 4 4  Quickly visualize a data frame 5 - 6 5  } 7 6  \description{ 8 7  Quickly visualize a data frame 9 - 10 8  } 11 9  \usage{ 12 10  plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, ... ... @@ -32,33 +30,17 @@ plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, 32 30  \details{ 33 31  The data frame contains heterogeneous information. The \code{\link{plotDataFrame}} function provides a simple and quick way to 34 32  visualize information that are stored in a data frame. 35 - 36 33  There are only a few advanced settings in this function, so the heamtap generated by this functioin 37 34  may look ugly (in most of the time). However, users can customize the style of the heatmaps by manually 38 35  constructing a \code{\link{HeatmapList}} object. 39 - 40 36  } 41 37  \value{ 42 38  a \code{\link{HeatmapList}} object. 43 - 44 39  } 45 40  \author{ 46 41  Zuguang Gu  47 - 48 42  } 49 43  \examples{ 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 44  df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 63 45  large = runif(10)*100, 64 46  t1 = sample(letters[1:3], 10, replace = TRUE), ... ... @@ -66,4 +48,5 @@ df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], lett 66 48  t2 = sample(LETTERS[1:3], 10, replace = TRUE)) 67 49  plotDataFrame(df) 68 50  plotDataFrame(df, group = list(1:4, 5, 6, 7:12, 13), group_names = c("mat1", "large", "t1", "mat2", "t2"), 69 - main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title")} 51 + main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title") 52 +}

Commit made by the Bioconductor Git-SVN bridge.

Commit id: 262e3960558c1f61b986f5be7a2ffd4599f704fa

comprehensive modifications

z.gu authored on 10/08/2015 22:17:54
Showing1 changed files
 ... ... @@ -54,6 +54,11 @@ Zuguang Gu  54 54   55 55   56 56   57 + 58 + 59 + 60 + 61 + 57 62  df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 58 63  large = runif(10)*100, 59 64  t1 = sample(letters[1:3], 10, replace = TRUE),

Commit made by the Bioconductor Git-SVN bridge.

Commit id: 73171be89c157222e8e71e85daa8a37ce509a4e2

add border argument in anno_* family functions

z.gu authored on 06/08/2015 17:46:06
Showing1 changed files
 ... ... @@ -53,6 +53,7 @@ Zuguang Gu  53 53   54 54   55 55   56 + 56 57  df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 57 58  large = runif(10)*100, 58 59  t1 = sample(letters[1:3], 10, replace = TRUE),

Commit made by the Bioconductor Git-SVN bridge.

Commit id: 3429d28233ef2cbeafcd05307042d7c7aa54a2a2

z.gu authored on 06/08/2015 16:40:59
Showing1 changed files
 ... ... @@ -49,6 +49,10 @@ Zuguang Gu  49 49  \examples{ 50 50   51 51   52 + 53 + 54 + 55 + 52 56  df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 53 57  large = runif(10)*100, 54 58  t1 = sample(letters[1:3], 10, replace = TRUE),

Commit made by the Bioconductor Git-SVN bridge.

allow reordering

z.gu authored on 04/08/2015 20:24:37
Showing1 changed files
 ... ... @@ -47,6 +47,8 @@ Zuguang Gu  47 47   48 48  } 49 49  \examples{ 50 + 51 + 50 52  df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 51 53  large = runif(10)*100, 52 54  t1 = sample(letters[1:3], 10, replace = TRUE),

Commit made by the Bioconductor Git-SVN bridge.

remove plot.HeatmapList and print.HeatmapList

z.gu authored on 18/07/2015 18:14:29
Showing1 changed files
 ... ... @@ -1,44 +1,45 @@ 1 1  \name{plotDataFrame} 2 2  \alias{plotDataFrame} 3 3  \title{ 4 -Visualize a data frame 4 +Quickly visualize a data frame 5 5   6 6  } 7 7  \description{ 8 -Visualize a data frame 8 +Quickly visualize a data frame 9 9   10 10  } 11 11  \usage{ 12 -plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, show_column_names = TRUE, 13 - group = NULL, group_names = names(group), main_heatmap = NULL, km = 1, split = NULL, 14 - cluster_rows = TRUE, cluster_columns = TRUE, ...)} 12 +plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, 13 + show_column_names = TRUE, group = NULL, group_names = names(group), 14 + main_heatmap = NULL, km = 1, split = NULL, cluster_rows = TRUE, 15 + cluster_columns = TRUE, ...)} 15 16  \arguments{ 16 17   17 - \item{df}{a data frame} 18 - \item{overlap}{how to group numeric columns. If the overlapping rate between the ranges in thecurrent column and previous numeric column is larger than this value, the two columnsare thought under same measurement and should be grouped.} 19 - \item{nlevel}{If the number of levels of a character column is larger than this value, the column willbe excluded.} 18 + \item{df}{a data frame.} 19 + \item{overlap}{how to group numeric columns. If the overlapping rate between the ranges in thecurrent column and previous numeric column is larger than this value, the two columnsare treated as under same measurement and should be grouped.} 20 + \item{nlevel}{If the number of levels of a character column is larger than this value, the column willbe excluded, because it doesn't make any sense to visualize a character vector or matrixthat contains huge number of unique elements through a heatmap.} 20 21  \item{show_row_names}{whether show row names after the last heatmap if there are row names.} 21 - \item{show_column_names}{whether show column names for all heatmaps} 22 - \item{group}{a list of index that defines the groupping} 23 - \item{group_names}{names for each group} 24 - \item{main_heatmap}{which group is the main heatmap} 25 - \item{km}{apply k-means clustering on rows for the main heatmap} 26 - \item{split}{set a splitting variable on rows for the main heatmap} 27 - \item{cluster_rows}{whether perform clustering on rows of the first heatmap} 28 - \item{cluster_columns}{whether perform clustering on columns for all heatmaps} 22 + \item{show_column_names}{whether show column names for all heatmaps.} 23 + \item{group}{a list of index that defines the groupping.} 24 + \item{group_names}{names for each group.} 25 + \item{main_heatmap}{which group is the main heatmap?} 26 + \item{km}{a value larger than 1 means applying k-means clustering on rows for the main heatmap.} 27 + \item{split}{one or multiple variables that split the rows.} 28 + \item{cluster_rows}{whether perform clustering on rows of the main heatmap.} 29 + \item{cluster_columns}{whether perform clustering on columns for all heatmaps.} 29 30  \item{...}{pass to \code{\link{draw,HeatmapList-method}} or \code{\link{make_layout,HeatmapList-method}}} 30 31  } 31 32  \details{ 32 -The data frame contains information from different aspects and different measurements are applied 33 -on the same element for each row. The \code{\link{plotDataFrame}} function provides a simple and quick way to 33 +The data frame contains heterogeneous information. The \code{\link{plotDataFrame}} function provides a simple and quick way to 34 34  visualize information that are stored in a data frame. 35 35   36 -There are not many advanced settings in this function. Users can customize the style of the heatmaps 37 -by constructing a \code{\link{HeatmapList}} object. 36 +There are only a few advanced settings in this function, so the heamtap generated by this functioin 37 +may look ugly (in most of the time). However, users can customize the style of the heatmaps by manually 38 +constructing a \code{\link{HeatmapList}} object. 38 39   39 40  } 40 41  \value{ 41 -a \code{\link{HeatmapList}} object 42 +a \code{\link{HeatmapList}} object. 42 43   43 44  } 44 45  \author{ ... ... @@ -46,7 +47,6 @@ Zuguang Gu  46 47   47 48  } 48 49  \examples{ 49 - 50 50  df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 51 51  large = runif(10)*100, 52 52  t1 = sample(letters[1:3], 10, replace = TRUE),

Commit made by the Bioconductor Git-SVN bridge.

Commit id: 4cbce102eabb1633fc8980b1374795bfb44507df

Merge branch 'master' of https://github.com/jokergoo/ComplexHeatmap

Commit id: a15bbec76c85c15bc27273ce15f5118ea087132f

refreshed documentatinos

Commit id: b1fe0a94aa09a4a47e5a02383ce662580f057bdc

ColorMapping object has default value for name slot

z.gu authored on 16/07/2015 15:21:23
Showing1 changed files
 ... ... @@ -46,6 +46,7 @@ Zuguang Gu  46 46   47 47  } 48 48  \examples{ 49 + 49 50  df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 50 51  large = runif(10)*100, 51 52  t1 = sample(letters[1:3], 10, replace = TRUE),

Commit made by the Bioconductor Git-SVN bridge.

Commit id: ff9ffa810ca9f16a253861d97301062962dbe38b

titles support expression now

z.gu authored on 13/07/2015 21:26:16
Showing1 changed files
 ... ... @@ -46,8 +46,6 @@ Zuguang Gu  46 46   47 47  } 48 48  \examples{ 49 - 50 - 51 49  df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 52 50  large = runif(10)*100, 53 51  t1 = sample(letters[1:3], 10, replace = TRUE),

Commit made by the Bioconductor Git-SVN bridge.

Commit id: e811f8100ef035ff75c16312b3e5112cc82d4a49

continuous legend is supported

z.gu authored on 13/07/2015 10:21:55
Showing1 changed files
 ... ... @@ -46,6 +46,8 @@ Zuguang Gu  46 46   47 47  } 48 48  \examples{ 49 + 50 + 49 51  df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 50 52  large = runif(10)*100, 51 53  t1 = sample(letters[1:3], 10, replace = TRUE),

Commit made by the Bioconductor Git-SVN bridge.

Commit id: 2786dac4ddaa97c69cc24e29e121ed1a1624cdf4

Merge branch 'master' of https://github.com/jokergoo/mheatmap

Commit id: a61c101325601aa0d4d3ba81e10c33d4a8b34c63

rows can be split if providing a clustering object

z.gu authored on 06/07/2015 22:31:19
Showing1 changed files
 ... ... @@ -46,8 +46,6 @@ Zuguang Gu  46 46   47 47  } 48 48  \examples{ 49 - 50 - 51 49  df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 52 50  large = runif(10)*100, 53 51  t1 = sample(letters[1:3], 10, replace = TRUE), ... ... @@ -55,6 +53,4 @@ df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], lett 55 53  t2 = sample(LETTERS[1:3], 10, replace = TRUE)) 56 54  plotDataFrame(df) 57 55  plotDataFrame(df, group = list(1:4, 5, 6, 7:12, 13), group_names = c("mat1", "large", "t1", "mat2", "t2"), 58 - main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title") 59 - 60 -} 56 + main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title")}

Commit made by the Bioconductor Git-SVN bridge.

Commit id: 9d7fc297a370b44dd3bfb12696ed9eac33aed48a

refreshed documentations

z.gu authored on 23/06/2015 10:24:06
Showing1 changed files
 ... ... @@ -47,6 +47,7 @@ Zuguang Gu  47 47  } 48 48  \examples{ 49 49   50 + 50 51  df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 51 52  large = runif(10)*100, 52 53  t1 = sample(letters[1:3], 10, replace = TRUE),

Commit made by the Bioconductor Git-SVN bridge.

refreshed documentations

z.gu authored on 23/06/2015 08:33:59
Showing1 changed files
 ... ... @@ -46,6 +46,7 @@ Zuguang Gu  46 46   47 47  } 48 48  \examples{ 49 + 49 50  df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 50 51  large = runif(10)*100, 51 52  t1 = sample(letters[1:3], 10, replace = TRUE), ... ... @@ -53,4 +54,6 @@ df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], lett 53 54  t2 = sample(LETTERS[1:3], 10, replace = TRUE)) 54 55  plotDataFrame(df) 55 56  plotDataFrame(df, group = list(1:4, 5, 6, 7:12, 13), group_names = c("mat1", "large", "t1", "mat2", "t2"), 56 - main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title")} 57 + main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title") 58 + 59 +}

Commit made by the Bioconductor Git-SVN bridge.

refresh documentations and NAMESPACE

z.gu authored on 22/06/2015 21:57:04
Showing1 changed files
 ... ... @@ -1,25 +1,22 @@ 1 1  \name{plotDataFrame} 2 2  \alias{plotDataFrame} 3 3  \title{ 4 -Visualize a data frame  5 - 4 +Visualize a data frame 6 5   7 6  } 8 7  \description{ 9 -Visualize a data frame  10 - 8 +Visualize a data frame 11 9   12 10  } 13 11  \usage{ 14 12  plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, show_column_names = TRUE, 15 13  group = NULL, group_names = names(group), main_heatmap = NULL, km = 1, split = NULL, 16 - cluster_rows = TRUE, cluster_columns = TRUE, ...) 17 -} 14 + cluster_rows = TRUE, cluster_columns = TRUE, ...)} 18 15  \arguments{ 19 16   20 17  \item{df}{a data frame} 21 - \item{overlap}{how to group numeric columns. If the overlapping rate between the ranges in the current column and previous numeric column is larger than this value, the two columns are thought under same measurement and should be grouped.} 22 - \item{nlevel}{If the number of levels of a character column is larger than this value, the column will be excluded.} 18 + \item{overlap}{how to group numeric columns. If the overlapping rate between the ranges in thecurrent column and previous numeric column is larger than this value, the two columnsare thought under same measurement and should be grouped.} 19 + \item{nlevel}{If the number of levels of a character column is larger than this value, the column willbe excluded.} 23 20  \item{show_row_names}{whether show row names after the last heatmap if there are row names.} 24 21  \item{show_column_names}{whether show column names for all heatmaps} 25 22  \item{group}{a list of index that defines the groupping} ... ... @@ -30,23 +27,22 @@ plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, show_colum 30 27  \item{cluster_rows}{whether perform clustering on rows of the first heatmap} 31 28  \item{cluster_columns}{whether perform clustering on columns for all heatmaps} 32 29  \item{...}{pass to \code{\link{draw,HeatmapList-method}} or \code{\link{make_layout,HeatmapList-method}}} 33 - 34 30  } 35 31  \details{ 36 -The data frame contains information from different aspects and different measurements are applied on the same element for each row. The \code{\link{plotDataFrame}} function provides a simple and quick way to visualize information that are stored in a data frame.  37 - 38 -There are not many advanced settings in this function. Users can customize the style of the heatmaps by constructing a \code{\link{HeatmapList}} object.  32 +The data frame contains information from different aspects and different measurements are applied 33 +on the same element for each row. The \code{\link{plotDataFrame}} function provides a simple and quick way to 34 +visualize information that are stored in a data frame. 39 35   36 +There are not many advanced settings in this function. Users can customize the style of the heatmaps 37 +by constructing a \code{\link{HeatmapList}} object. 40 38   41 39  } 42 40  \value{ 43 -a \code{\link{HeatmapList}} object  44 - 41 +a \code{\link{HeatmapList}} object 45 42   46 43  } 47 44  \author{ 48 -Zuguang Gu  49 - 45 +Zuguang Gu  50 46   51 47  } 52 48  \examples{ ... ... @@ -57,5 +53,4 @@ df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], lett 57 53  t2 = sample(LETTERS[1:3], 10, replace = TRUE)) 58 54  plotDataFrame(df) 59 55  plotDataFrame(df, group = list(1:4, 5, 6, 7:12, 13), group_names = c("mat1", "large", "t1", "mat2", "t2"), 60 - main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title") 61 -} 56 + main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title")}

Commit made by the Bioconductor Git-SVN bridge.

rotation for heatmap title supported

z.gu authored on 22/06/2015 15:09:06
Showing1 changed files
 ... ... @@ -1,22 +1,25 @@ 1 1  \name{plotDataFrame} 2 2  \alias{plotDataFrame} 3 3  \title{ 4 -Visualize a data frame 4 +Visualize a data frame  5 + 5 6   6 7  } 7 8  \description{ 8 -Visualize a data frame 9 +Visualize a data frame  10 + 9 11   10 12  } 11 13  \usage{ 12 14  plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, show_column_names = TRUE, 13 15  group = NULL, group_names = names(group), main_heatmap = NULL, km = 1, split = NULL, 14 - cluster_rows = TRUE, cluster_columns = TRUE, ...)} 16 + cluster_rows = TRUE, cluster_columns = TRUE, ...) 17 +} 15 18  \arguments{ 16 19   17 20  \item{df}{a data frame} 18 - \item{overlap}{how to group numeric columns. If the overlapping rate between the ranges in thecurrent column and previous numeric column is larger than this value, the two columnsare thought under same measurement and should be grouped.} 19 - \item{nlevel}{If the number of levels of a character column is larger than this value, the column willbe excluded.} 21 + \item{overlap}{how to group numeric columns. If the overlapping rate between the ranges in the current column and previous numeric column is larger than this value, the two columns are thought under same measurement and should be grouped.} 22 + \item{nlevel}{If the number of levels of a character column is larger than this value, the column will be excluded.} 20 23  \item{show_row_names}{whether show row names after the last heatmap if there are row names.} 21 24  \item{show_column_names}{whether show column names for all heatmaps} 22 25  \item{group}{a list of index that defines the groupping} ... ... @@ -27,22 +30,23 @@ plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, show_colum 27 30  \item{cluster_rows}{whether perform clustering on rows of the first heatmap} 28 31  \item{cluster_columns}{whether perform clustering on columns for all heatmaps} 29 32  \item{...}{pass to \code{\link{draw,HeatmapList-method}} or \code{\link{make_layout,HeatmapList-method}}} 33 + 30 34  } 31 35  \details{ 32 -The data frame contains information from different aspects and different measurements are applied 33 -on the same element for each row. The \code{\link{plotDataFrame}} function provides a simple and quick way to 34 -visualize information that are stored in a data frame. 36 +The data frame contains information from different aspects and different measurements are applied on the same element for each row. The \code{\link{plotDataFrame}} function provides a simple and quick way to visualize information that are stored in a data frame.  37 + 38 +There are not many advanced settings in this function. Users can customize the style of the heatmaps by constructing a \code{\link{HeatmapList}} object.  35 39   36 -There are not many advanced settings in this function. Users can customize the style of the heatmaps 37 -by constructing a \code{\link{HeatmapList}} object. 38 40   39 41  } 40 42  \value{ 41 -a \code{\link{HeatmapList}} object 43 +a \code{\link{HeatmapList}} object  44 + 42 45   43 46  } 44 47  \author{ 45 -Zuguang Gu  48 +Zuguang Gu  49 + 46 50   47 51  } 48 52  \examples{ ... ... @@ -53,4 +57,5 @@ df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], lett 53 57  t2 = sample(LETTERS[1:3], 10, replace = TRUE)) 54 58  plotDataFrame(df) 55 59  plotDataFrame(df, group = list(1:4, 5, 6, 7:12, 13), group_names = c("mat1", "large", "t1", "mat2", "t2"), 56 - main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title")} 60 + main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title") 61 +}

Commit made by the Bioconductor Git-SVN bridge.

check row orders

z.gu authored on 21/06/2015 17:44:09
Showing1 changed files
 ... ... @@ -1,25 +1,22 @@ 1 1  \name{plotDataFrame} 2 2  \alias{plotDataFrame} 3 3  \title{ 4 -Visualize a data frame  5 - 4 +Visualize a data frame 6 5   7 6  } 8 7  \description{ 9 -Visualize a data frame  10 - 8 +Visualize a data frame 11 9   12 10  } 13 11  \usage{ 14 12  plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, show_column_names = TRUE, 15 13  group = NULL, group_names = names(group), main_heatmap = NULL, km = 1, split = NULL, 16 - cluster_rows = TRUE, cluster_columns = TRUE, ...) 17 -} 14 + cluster_rows = TRUE, cluster_columns = TRUE, ...)} 18 15  \arguments{ 19 16   20 17  \item{df}{a data frame} 21 - \item{overlap}{how to group numeric columns. If the overlapping rate between the ranges in the current column and previous numeric column is larger than this value, the two columns are thought under same measurement and should be grouped.} 22 - \item{nlevel}{If the number of levels of a character column is larger than this value, the column will be excluded.} 18 + \item{overlap}{how to group numeric columns. If the overlapping rate between the ranges in thecurrent column and previous numeric column is larger than this value, the two columnsare thought under same measurement and should be grouped.} 19 + \item{nlevel}{If the number of levels of a character column is larger than this value, the column willbe excluded.} 23 20  \item{show_row_names}{whether show row names after the last heatmap if there are row names.} 24 21  \item{show_column_names}{whether show column names for all heatmaps} 25 22  \item{group}{a list of index that defines the groupping} ... ... @@ -30,23 +27,22 @@ plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, show_colum 30 27  \item{cluster_rows}{whether perform clustering on rows of the first heatmap} 31 28  \item{cluster_columns}{whether perform clustering on columns for all heatmaps} 32 29  \item{...}{pass to \code{\link{draw,HeatmapList-method}} or \code{\link{make_layout,HeatmapList-method}}} 33 - 34 30  } 35 31  \details{ 36 -The data frame contains information from different aspects and different measurements are applied on the same element for each row. The \code{\link{plotDataFrame}} function provides a simple and quick way to visualize information that are stored in a data frame.  37 - 38 -There are not many advanced settings in this function. Users can customize the style of the heatmaps by constructing a \code{\link{HeatmapList}} object.  32 +The data frame contains information from different aspects and different measurements are applied 33 +on the same element for each row. The \code{\link{plotDataFrame}} function provides a simple and quick way to 34 +visualize information that are stored in a data frame. 39 35   36 +There are not many advanced settings in this function. Users can customize the style of the heatmaps 37 +by constructing a \code{\link{HeatmapList}} object. 40 38   41 39  } 42 40  \value{ 43 -a \code{\link{HeatmapList}} object  44 - 41 +a \code{\link{HeatmapList}} object 45 42   46 43  } 47 44  \author{ 48 -Zuguang Gu  49 - 45 +Zuguang Gu  50 46   51 47  } 52 48  \examples{ ... ... @@ -57,5 +53,4 @@ df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], lett 57 53  t2 = sample(LETTERS[1:3], 10, replace = TRUE)) 58 54  plotDataFrame(df) 59 55  plotDataFrame(df, group = list(1:4, 5, 6, 7:12, 13), group_names = c("mat1", "large", "t1", "mat2", "t2"), 60 - main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title") 61 -} 56 + main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title")}

Commit made by the Bioconductor Git-SVN bridge.

Commit id: 7ce8bf6b9a307c61c0f6297e94039cb5e8386bd2

support main heatmap in plotDataFrame()

z.gu authored on 15/06/2015 18:58:19
Showing1 changed files
 ... ... @@ -11,9 +11,9 @@ Visualize a data frame 11 11   12 12  } 13 13  \usage{ 14 -plotDataFrame(df, overlap = 0.5, nlevel = 30, show_row_names = TRUE, 15 - group = NULL, group_name = names(group), cluster_rows = TRUE, 16 - cluster_columns = TRUE) 14 +plotDataFrame(df, overlap = 0.25, nlevel = 30, show_row_names = TRUE, show_column_names = TRUE, 15 + group = NULL, group_names = names(group), main_heatmap = NULL, km = 1, split = NULL, 16 + cluster_rows = TRUE, cluster_columns = TRUE, ...) 17 17  } 18 18  \arguments{ 19 19   ... ... @@ -21,10 +21,15 @@ plotDataFrame(df, overlap = 0.5, nlevel = 30, show_row_names = TRUE, 21 21  \item{overlap}{how to group numeric columns. If the overlapping rate between the ranges in the current column and previous numeric column is larger than this value, the two columns are thought under same measurement and should be grouped.} 22 22  \item{nlevel}{If the number of levels of a character column is larger than this value, the column will be excluded.} 23 23  \item{show_row_names}{whether show row names after the last heatmap if there are row names.} 24 + \item{show_column_names}{whether show column names for all heatmaps} 24 25  \item{group}{a list of index that defines the groupping} 25 - \item{group_name}{names for each group} 26 + \item{group_names}{names for each group} 27 + \item{main_heatmap}{which group is the main heatmap} 28 + \item{km}{apply k-means clustering on rows for the main heatmap} 29 + \item{split}{set a splitting variable on rows for the main heatmap} 26 30  \item{cluster_rows}{whether perform clustering on rows of the first heatmap} 27 31  \item{cluster_columns}{whether perform clustering on columns for all heatmaps} 32 + \item{...}{pass to \code{\link{draw,HeatmapList-method}} or \code{\link{make_layout,HeatmapList-method}}} 28 33   29 34  } 30 35  \details{ ... ... @@ -45,8 +50,12 @@ Zuguang Gu  45 50   46 51  } 47 52  \examples{ 48 -df = data.frame(x = rnorm(10), y = rnorm(10), z = rnorm(10, 10),  49 - l1 = letters[1:10], l2 = LETTERS[1:10]) 53 +df = data.frame(matrix(rnorm(40), nrow = 10, dimnames = list(letters[1:10], letters[1:4])), 54 + large = runif(10)*100, 55 + t1 = sample(letters[1:3], 10, replace = TRUE), 56 + matrix(runif(60), nrow = 10, dimnames = list(LETTERS[1:10], LETTERS[1:6])), 57 + t2 = sample(LETTERS[1:3], 10, replace = TRUE)) 50 58  plotDataFrame(df) 51 -plotDataFrame(df, group = list(number = 1:3, letters = 4:5)) 59 +plotDataFrame(df, group = list(1:4, 5, 6, 7:12, 13), group_names = c("mat1", "large", "t1", "mat2", "t2"), 60 + main_heatmap = 4, km = 2, column_title = "column title", row_title = "row title") 52 61  }

Commit made by the Bioconductor Git-SVN bridge.

Commit id: c2a58ed184d534d16fc4ec5cb5df64fa199fe5b0

change the way to overlap two intervals

Commit id: 7a90e91451128103fee12f7eeb03176aba3d724d

add plotDataFrame() which visualize a data frame

 1 1 new file mode 100644 ... ... @@ -0,0 +1,52 @@ 1 +\name{plotDataFrame} 2 +\alias{plotDataFrame} 3 +\title{ 4 +Visualize a data frame  5 + 6 + 7 +} 8 +\description{ 9 +Visualize a data frame  10 + 11 + 12 +} 13 +\usage{ 14 +plotDataFrame(df, overlap = 0.5, nlevel = 30, show_row_names = TRUE, 15 + group = NULL, group_name = names(group), cluster_rows = TRUE, 16 + cluster_columns = TRUE) 17 +} 18 +\arguments{ 19 + 20 + \item{df}{a data frame} 21 + \item{overlap}{how to group numeric columns. If the overlapping rate between the ranges in the current column and previous numeric column is larger than this value, the two columns are thought under same measurement and should be grouped.} 22 + \item{nlevel}{If the number of levels of a character column is larger than this value, the column will be excluded.} 23 + \item{show_row_names}{whether show row names after the last heatmap if there are row names.} 24 + \item{group}{a list of index that defines the groupping} 25 + \item{group_name}{names for each group} 26 + \item{cluster_rows}{whether perform clustering on rows of the first heatmap} 27 + \item{cluster_columns}{whether perform clustering on columns for all heatmaps} 28 + 29 +} 30 +\details{ 31 +The data frame contains information from different aspects and different measurements are applied on the same element for each row. The \code{\link{plotDataFrame}} function provides a simple and quick way to visualize information that are stored in a data frame.  32 + 33 +There are not many advanced settings in this function. Users can customize the style of the heatmaps by constructing a \code{\link{HeatmapList}} object.  34 + 35 + 36 +} 37 +\value{ 38 +a \code{\link{HeatmapList}} object  39 + 40 + 41 +} 42 +\author{ 43 +Zuguang Gu  44 + 45 + 46 +} 47 +\examples{ 48 +df = data.frame(x = rnorm(10), y = rnorm(10), z = rnorm(10, 10),  49 + l1 = letters[1:10], l2 = LETTERS[1:10]) 50 +plotDataFrame(df) 51 +plotDataFrame(df, group = list(number = 1:3, letters = 4:5)) 52 +}


text:
# Extending Animation Nodes

I'm using Blender 2.79 on Linux with Animation Nodes (Python 3.6).

I'd like to add a stopwatch directly as a node within Animation Nodes, without the Invoke Subprogram. Currently my stopwatch works correctly as a script subprogram, but I can't use it as easily as I'd like and I'm also trying to learn how different add-ons can work together (imagine an add-on extending an add-on instead of directly extending Blender...one add-on importing classes from another add-on).

Seeing how an independent script works is easy, I'm having trouble getting my stopwatch script to directly import AnimationNode in my stopwatch, and I'm not sure, but I suspect I need to do this to make my stopwatch part of Animation Nodes. Can my add-on somehow import AnimationNode? My import statements have all failed even when the path is added to where AnimationNode is, e.g., this fails:

from animation_nodes import AnimationNode

ImportError: cannot import name 'AnimationNode'

Would I have to modify Animation Nodes directly without the possibility of extending it via a separate add-on? I really hate the idea of directly modifying someone else's add-on.

• Before starting your own fork, try using a script node – sambler Jul 7 '18 at 4:00
• Addons are python modules (or package of modules) in the case of animation nodes it is all in submodules. You need to dig into the submodules to find what you need - from animation_nodes.base_types.nodes.base_node import AnimationNode class mynode(bpy.types.Node, AnimationNode): Then you need to register your node and add it to the add node menu. It isn't as straightforward as you would hope. I think adding a file for your node inside the existing addon is going to be the easy way. Have a look at dev guide – sambler Jul 7 '18 at 6:18

format: plain


text:
# The Freyd-Mitchell Embedding Theorem and projective (injective) objects

Given a small abelian category $\mathcal{A}$, the Freyd-Mitchell Embedding Theorem gives me a fully faithful exact functor $F:\mathcal{A}\rightarrow R$-$\mathsf{Mod}$, for some unital ring $R$, so that, in particular, $\mathcal{A}$ is equivalent to a full subcategory of $R$-$\mathsf{Mod}$.

Wikipedia states

However, projective and injective objects in $\mathcal{A}$ do not necessarily correspond to projective and injective $R$-modules.

Given that the definition of projective objects is entirely categorical in nature, how could it be that the notions of projective in each category do not correspond to each other in equivalent categories? Is this because the projective objects in a full subcategory of $R\mathsf{Mod}$ are sometimes different than the projective objects in all of $R$-$\mathsf{Mod}$?

(Of course, you can everywhere replace "projective" with "injective" in the above.)

• As you noted, $\mathcal{A}$ is not equivalent to $R$-Mod but rather to a full subcategory, where injectives need not be the same. – Seth Sep 13 '14 at 19:56

From the definitions, there's no reason to expect projective/injective objects of a subcategory to be projective/injective in the ambient category. If $P, B \in \mathcal{A}$, then any map $P \to B$ factors through any epi $A \twoheadrightarrow B$ with $A \in \mathcal{A}$, but if $A, B$ are not in $\mathcal{A}$, there is no reason to expect a lift.
An object $P$ is projective when, given any morphism $f: P \to A$, and any epimorphism $g: B \to A$, there is a unique morphism $h: P \to B$ such that $g \circ h = f$.
Even if an object $P$ is projective in a full subcategory of R-mod, then, it might not be projective in R-mod itself, because in that case the objects $A$ and $B$ might be outside of the subcategory over which $P$ is projective.


text:
# Equation of tangent line to curve

Printable View

• February 22nd 2009, 07:12 PM
roksteady
Equation of tangent line to curve
I need help solving these:

$y= tan (4x^2) at x0 = 0$

y= -ln(-x) at x0= -e

ANY HELP WOULD BE AWESOME!
• February 22nd 2009, 07:30 PM
mollymcf2009
Quote:

Originally Posted by roksteady
I need help solving these:

$y= tan (4x^2) at x0 = 0$

y= -ln(-x) at x0= -e

ANY HELP WOULD BE AWESOME!

For both of these, you need to use the chain rule for your derivative. Then to find the value at x=0 and x=-e, just plug them into your derivative and solve for y. Then use your x & y values for your slope intercept equation of a line to find the equations for your lines.


text:
Theory Manual Version 3.4
$\newcommand{\lyxlock}{}$
Subsection 6.2.3: Generalized Method for Elastodynamics Up Section 6.2: Elastodynamics Subsubsection 6.2.4.1: Internal Work

6.2.4 Linearization

The solution of the nonlinear equation is obtained by linearizing this relation as where the operator represents the directional derivative of at along an increment of [23]. According to the generalized method [42], the virtual work is evaluated using intermediate time step values, at for all parameters except , which is evaluated at . It follows from these definitions that the linearizations of critical variables are given by To linearize the virtual work, we need to express the integrals appearing in and over the material frame of the finite element solid domain.
Subsection 6.2.3: Generalized Method for Elastodynamics Up Section 6.2: Elastodynamics Subsubsection 6.2.4.1: Internal Work


text:
Published in

CodeX

# Adding LaTeX Rendering to Our Website, Part 2

## From Hugo in Action by Atishay Jain

Take 40% off Hugo in Action by entering fccjain into the discount code box at checkout at manning.com.

## Deploying to Heroku

In case you aren’t using Netlify, you need to select a vendor to host the APIs. Many cloud vendors support both the PAAS and the FAAS models and we’re free to decide what approach to take to deploy our website. Because Netlify uses the FAAS solution, we demonstrate a PAAS solution. Heroku is used as the PAAS platform, though we use little of its features and therefore the code should work in any PAAS platform we choose.

Heroku has integrations with both the Node.js ecosystem and GitHub making the deployment job for us easy. Heroku also provides continuous integration and deployment for our code without us having to write anything in our GitHub actions which makes our job easier. Once configured, we need to push the code to GitHub to get it live within Heroku.

• Next, we need to give the app a name. App names are unique in Heroku. latex2svg has been reserved for this article.
• We can now decide the mode of integration. Direct GitHub integration is the easiest and we use that for our use case. To connect to GitHub, you can go to Deploy > Deployment method > GitHub and then click on Connect to GitHub
• After providing credentials, we can search for repositories that we want to connect to Heroku, select the correct repository and then click connect.
• Before triggering the deployment, we need to go to the Settings tab and in the Buildpacks section select node.js. Because we have both go.sum and package.json, Heroku can get confused.

We need the node.js Buildpack for our APIs.

• In the settings there’s also a config vars section where we can define our environment variables. We need to define LATEX2SVG_PASSWORD for getting a password to restrict access.
• Once the build settings are setup we can trigger the deployment from Deploy > Manual Deploy. We should first do a manual deploy for verification that everything is correct before switching on automatic.

After the code goes live, we can call https://<endpoint>.herokuapp.com/latex2svg?tex=%5Cfrac%7Ba%7D%7Bb%7D&password=<password> to get the same response that we got previously when we ran locally.

We can troubleshoot any issues looking at the application logs which are provided in the More menu on the top right where we can click on View logs

## Monorepo vs separate repos for APIs and Markup

We decided to use the repository that was used for the website for the API code as well. This has a clear disadvantage of pushing the needless markup code to Heroku and rebuilding the Heroku based APIs every time a markup-based document has changes. If this turns into a big problem, we can choose to have a separate branch for the API or a separate repository. We can also change our integration to happen via GitHub actions instead of the direct Heroku import where we can build the smartness to recognize whether the API has changed. We can move to manual deploys if the APIs aren’t changing frequently.

The choice of a mono-repo has nothing to do with Hugo or the Jamstack. It’s a matter of personal preference. Netlify works a lot better with one repository and managing changes across APIs and their invocation in the core template code may be easier if using a monorepo.

## Creating shortcode to render LaTeX

With a functional API, the major work needed to get to rendering LaTeX on the website is done. We need to invoke it and then render the result. Now we need to create a shortcode to call the API and display the result in the Hugo based website.

Although we use the APIs at compile time, if we want to use them at runtime, the steps to setup the APIs are exactly the same. Instead of calling the API via Hugo, we use the fetch function.

In the shortcode, we take the LaTeX code as the inner content of the shortcode and then call the latex2svg API to get the SVG version of this LaTeX document that we can convert to a resource using resources.FromString or render inline as an SVG document. We’re rendering the SVG inline for our use case.

Although we can use the site.baseURL in the endpoint in case we use Netlify, it doesn’t work for compile time API access when the website has never been pushed live before. This causes the need to have a deployment twice – once to get the function up and the second time to call it. Unless calling from JavaScript, it is advisable to have a fixed URL for the API present in the config.

The other parameters of the API can be converted into arguments for the shortcode. We use the default values as supplied in the official MathJax documentation at http://docs.mathjax.org/en/latest/web/typeset.html.

The corresponding file is also present in the resources (https://github.com/hugoinaction/hugoinaction/tree/ch11-resources/4)

{{/* layouts/shortcodes/latex.html */}} {{/* layouts/shortcodes/latex.html */}} {{/* defaults taken from http://docs.mathjax.org/en/latest/web/typeset.html   {{/*  a Boolean specifying whether the math is in display-mode or inline mode */ {{ $display := true }} ❶ {{ with .Get "display" }} {{$display = . }} {{ end }}   {{/*  a number giving the number of pixels in an em for the surrounding font. */ {{ $em := 8 }} {{ with .Get "em" }} {{$em = . }} {{ end }}     {{/*  a number giving the number of pixels in an em for the surrounding font. */ {{ $ex := 16 }} {{ with .Get "ex" }} {{$ex = . }} {{ end}}   {{/*  a number giving the width of the container, in pixels. */}} {{ $containerWidth := (mul 80$ex) }} {{ with .Get "containerWidth" }} {{ $containerWidth = . }} {{ end }} {{/* a number giving the line-breaking width in em units. Default is a very large number (100000), so effectively no line breaking. */}} {{$lineWidth := 100000 }} {{ with .Get "lineWidth" }}   {{ $lineWidth = . }} {{ end }} {{/* a number giving a scaling factor to apply to the resulting conversion. Default is 1. */}} {{$scale := 1 }} {{ with .Get "scale" }} {{ $scale = . }} {{ end }} {{ if (and$.Site.Params.Latex2Svg (getenv "LATEX2SVG_PASSWORD") ) }} ❷   {{ $json := getJSON$.Site.Params.Latex2Svg "?" (querify "tex" .Inner) "&password=" (getenv "LATEX2SVG_PASSWORD") "&display=" $display "&em="$em "&ex=" $ex "&containerWidth="$containerWidth "&lineWidth=" $lineWidth "&scale="$scale}}   {{ with \$json.data }}   {{. | safeHTML}} ❸ {{ end }} {{ end }}

Setup all parameters with meaningful defaults

Disallow calling the server if there’s no LATEX2SVG_PASSWORD or the endpoint isn’t defined.

Embed the data without escaping the SVG content inline.

Next, we need to enter the Latex2Svg endpoint in the website config, which depends on whether you used Heroku or Netlify for deployment.

# config/_default/params.yaml Latex2Svg: https://<endpoint>.herokuapp.com/latex2svg # or Latex2Svg: https://<endpoint>/.netlify/functions/latex2svg

If we don’t want to call into the cloud service, we can use the http://localhost:3000/latex2svg as the URL inside of config/development/params.yaml. We can also disable the call during development by setting this to blank.

## Adding some LaTex in our website

With all the hard work done to get a shortcode to render latex, the next step is to write some LaTeX in our website. In our blog,we’ve a page on triangles.

Let’s add the formula for the area of a triangle in there:

<!-- content/blog/tropical triangles/index.md --> {{< latex>}}\text{Area} = \frac{b \times h}{2}{{</latex>}}

Let’s do the same in circle:

content/blog/community/circle.md –>
{{< latex>}}\text{Area} = \pi r²{{</latex>}}

We can also do complex mathematical equations like the mathematical definition of a Bézier curve.

{{< latex>}} <!--  content/blog/community/curve.md --> \mathbf {B} (t)=\sum _{i=0}^{n}{n \choose i}(1-t)^{n-i}t^{i}\mathbf {P} _{i} {{</ latex>}}

We can do inline LaTeX as well.

<!--  content/blog/community/circle.md --> The area of a circle is {{<latex display="false">}} \pi r^2 {{</latex>}}

Code Checkpoint. Live at https://ch11–2.hugoinaction.com. Source code at https://github.com/hugoinaction/hugoinaction/tree/ch11-2

--

--


text:
Question

# Explain 1 unit of electricity in India.

Open in App
Solution

## 1 unit of electricity in India is equivalent to 1 kWh.1 kWh is defined as the energy consumed by a power source of 1 kW for 1 hour.$1kWh=1000Wh\phantom{\rule{0ex}{0ex}}=1000×60×60s\phantom{\rule{0ex}{0ex}}1kWh=3.6×{10}^{6}J$

Suggest Corrections
13


text:
• # question_answer An ideal refrigerator has a freezer at a temperature of $-13{}^\circ C.$ The coefficient of performance of the engine is 5. The temperature of the air (to which heat is rejected) will be A) 325°C B) 325K C) 39°C     D) 320°C

 [c]Coefficient of performance $K=\frac{{{T}_{2}}}{{{T}_{1}}-{{T}_{2}}}$Þ$5=\frac{(273-13)}{{{T}_{1}}-(273-13)}=\frac{260}{{{T}_{1}}-260}$ Þ $5{{T}_{1}}-1300=260$Þ $5{{T}_{1}}=1560$ Þ ${{T}_{1}}=312K\to 39{}^\circ C$


text:
A root is defined as a directory that contains a regular file whose name matches a given pattern and which optionally contains a given text. The search for a root starts at a given directory (the working directory by default), and proceeds up the directory hierarchy. get_root_desc() returns the description of the criterion for a root path. This is especially useful for composite root criteria created with |.root_criterion().

find_root(criterion, path = ".")

get_root_desc(criterion, path)

## Arguments

criterion A criterion, will be coerced using as.root_criterion() The start directory

## Value

The normalized path of the root as specified by the search criterion. Throws an error if no root is found

## Details

Starting from the working directory, the find_root() function searches for the root. If a root is found, the ... arguments are used to construct a path; thus, if no extra arguments are given, the root is returned. If no root is found, an error is thrown.

utils::glob2rx() file.path()
# NOT RUN {


text:
# Did you count your hops?

Hoppy the Rabbit lives on the vertices of a regular 2015-gon with vertices labelled $$1,2,3,4\dots 2015$$. Hoppy lives on vertex 1, and he wishes to visit every vertex this year. To do this he buys a $$k$$-hopping machine. The $$k$$-hopping machine allows Hoppy to hop from his current vertex (assume it has number $$v$$) to the vertex with the number $$v+k$$. If $$v+k>2015$$ it sends him to vertex $$v+k-2015$$ instead. The $$k$$ hopping machines exist for $$k=1,2,3\dots 2015$$. What is the sum of the values of $$k$$ for which the $$k$$-hopping machine allows Hoppy to reach all of the vertices, starting at vertex 1 and hopping a finite number of times?

×