The first release for CRAN. The package is down to two blocks, the chart and the table, rewritten on one specification of their arguments that the constructors, the gear, saved boards, title slots and the assistant all read.
new_chart_block() draws bar, histogram, waterfall, pie, treemap, box,
point range, scatter, line, area, band and timeline charts with ECharts.new_table_block() has three layouts, "records" (the input's rows),
"groups" (one row per group, one column per summary) and
"variables" (a Table 1), each drawn as a "table", a "compact"
matrix or "cards". It replaces the tile, summarize, summary and gt
table blocks.new_summarize_table_block() and new_summary_table_block() are
deprecated. Called from code they return the table block with a
deprecatedWarning. A saved board that has one restores it as a table
block and shows a toast that asks the user to save the board.vignette("chart") and vignette("table") go through the arguments.table_gear() names
its tabs, sections and rows, and new_table_block(gear = , class = )
takes it with a class of the block's own. A row is a table setting, a
value the prepare script declares, a checklist of listing columns, a
pick of the column that groups the rows, "In the subtitle" ticks that
write the subtitle's clauses, or an editor a package registers in the
browser. Settings the gear does not name have no row and still work
from code and through their words. Such a block saves and restores
under its own constructor.facet_row lays the panels out as a grid, facet_row levels
down and facet levels across, for every chart type. With
facet_scales = "free_y" each row has its own value axis. Every panel
draws its tick labels; each axis title shows once per row or column. The
data view, the Excel download and the PNG, PowerPoint and web page
exports know the grid.type, x, y, position, y_transform,
percent_of, drill_target, selection, columns, by. The Legacy
section lists the old names.category and value, with func, as boards before
0.3.0 did with group and value. orientation only turns the marks;
switching it never swaps the two. x and y are the screen axes of
scatter, line, area and band, the histogram's binned column and the
gantt's interval and lane. In code, an aggregated type mapped with x or
y and no category is an error. 0.3.0's screen-axis x/y for these
types and its orientation inference are gone, and y_lines is
value_lines again.x_limits and y_limits: from and to, NA
at either end for auto, dates as "2024-01-01". y_limits is the value
axis on the aggregated types. Marks outside are cut off, not dropped. The
gear has a row of two fields for each; a log axis refuses an end at or
below 0 and says why. A subtitle template names them as {@y_limits},
printed "20 to auto", and on the face each end is a word typed over on
its own. In a panel grid the limits apply to every panel, over the shared
scales. Exports draw them.x_ticks and y_ticks, on the same axes as
the limits. One value is a step: 10 ticks at the multiples of 10, and a
date axis takes a unit, "7 days", "2 weeks", "month", "quarter", "year".
Days and weeks count from the axis start, months from the first. Two
values or more are the ticks, c(0, 25, 50, 100). A step rounds an auto
end out to the next tick; a list keeps the range. A log axis takes a list
only. The gear has a row per axis, Auto, Every or At, and a form picked
starts from the ticks drawn now. A subtitle template names them as
{@y_ticks}, printed "every 25" or "at 0, 25, 50", and on the face each
part is a word: the form and the unit pick from a menu, the step and the
list are typed over. Zoomed in past the ticks, the axis draws its own
until the reset. In a panel grid with free scales each panel keeps the
step over its own range. Exports draw them.visible) survives a
restore.node tools/bundle.js. With
options(blockr.viz.dev_js = TRUE) it loads the single source files.
Chart themes and the image export are loaded when first used.category, value, x, y and color when its type
changes; a setting a type does not use is hidden in the gear, not
cleared. Picking func = "count" no longer clears value.x or the sort
order, are worked out when the chart is drawn and are not saved.color = NULL now means no color; the default is "auto".
Boards saved before this version keep their old meaning.sort_by = "value", else ascending.by shows as one failed column with its error; the table
still draws.top_n reads "18 more groups not
shown, the largest with 73 events" (was "Other — 18 groups below the
cut, each with a value ≤ 73").by level
({@parent}) and the chip a dropped clause leaves read "Grouped by". A
word's menu lists exactly the columns of its in list.by
columns) show the group's name across the row, with the groups open,
and no summaries. A folded group adds the number of rows it hides in
grey ("Cardiac disorders 2"). The new group_rows setting (gear: Look,
"Group rows") draws them with "summary": every summary over the
group's rows, on the group's own line like any other row. A summary with func = "identity" never draws
on an outer row, where it showed the first inner row's value. Boards
saved before 0.3.0.9000 with a nested table keep "summary". The
downloads follow the setting.interactive_table(), with a spanner row above the row it
spans. A table runs its full length in the panel, and in the records and
structured layouts the header scrolled away with the rows.open column, "Open end" in the gear, as the
table's swimlane does. A TRUE row draws an arrowhead after its bar and reads
"ongoing" in the tooltip; one without an end runs to the last x drawn.Date or POSIXct columns draws its
bars on a time axis. The dates were lanes of categories, the bars shrank
to ticks and x_limits and the zoom did nothing. The tooltip prints the
dates, with the hour for a date-time, and the length in days.event_shape level (an end of treatment beside CR, PR, PD and death).type = "spans") takes lanes. A lane column puts a
record on a thin line of its own above the main bar, so a row grows with
its lanes (one per drug in a swimmer); records without a lane stay on the
main bar, and a table without a main bar draws equal lanes. seg_style
draws a record dashed, hollow, as dots, as a step or outlined, bar_label
writes text on or after a bar, and strip adds a strip of boxes to the
hover card. open now works per record: a TRUE record without an end
runs to the axis end with an arrow, and its tooltip reads "ongoing".NA ("automatic").size = "lg") draws its axis in
its header, as every other column does, so it stays in view with the
header while the rows scroll, as in 0.2.200. It was in a row under the
table, in view only after scrolling past the last row.{@rowname}, {label(@rowname)}, {@look} and {@by} were empty
there.drill_target is a
drill, as a click on a bar is: sent once, when the drag ends, with a trace
of the rectangle that fades and a "Drilled down to ..." receipt. While the
reader drags, the points outside the rectangle are dimmed. The chart no
longer keeps the brush as a selection, and clearing the rectangle no
longer takes the cohort back from the target. Before, every move of the
drag sent, the brush stayed latched with a "Filtered: ..." line, and its
clear button retracted the drill. A board saved with a selection on a chart that has a
drill_target restores without it: the chart's output is unfiltered.drill_target, a chart with a drill column filters its output to the
brushed (or clicked) points, not to every row that shares their drill
value; the subject's points at other visits are no longer selected. A
drill target still receives the drill column's values of those points.drill_target clears the selection at the old target
once; it was cleared twice.new_summarize_table_block(), draws no row for a missing group, as
before: such rows count toward N. The table block's own missing still
defaults to "level".by, colour or facet column that is missing in
every row counts as unset, as if the column were absent, under either
missing. Upstream switches a grouping off by filling its column with
NA. An all-NA facet column no longer crashes the groups layout under
missing = "drop". When every by column is missing in every row, the
inner one stays: the table is empty under missing = "drop", as in 0.2,
and custom summaries no longer fail with "dropped the grouping by .all".[, split by {label(@facet)}] part of the text drops.missing = "drop", and a
[ by {label(@category)}] part of the text drops. A category the data
lacks still shows "Mapped column not in data". A box or point range for
the missing level of a category with other values is no longer empty.AVAL no longer appear there. A saved value the menu does not offer is
listed as it is.Subgroup before one is picked) shows as "(none)" in the gear and on the
block's face, as the chart draws it, and waits under "+ Add a mapping".
The saved name stays and applies again once the column is there; picking
another column replaces it. A required mapping still names the column it
lacks with "(missing)".value_lines and x_lines "Reference lines" again,
as before 0.3.0, in its rows, the title offers and the @ list. A bar,
which takes them on both axes, reads "Reference lines (value axis)" and
"Reference lines (category axis)". Scatter, line and area keep
"Horizontal" and "Vertical".Blockr.trayNav until blockr.ui ships it, and uses blockr.ui's own once
it does.new_gt_table_block(), gt_table()); gt is no
longer suggested.new_chart_block(type = "waterfall").new_tile_block(). A tile is new_table_block(look = "cards"). Saved
tile boards restore as table blocks in the cards look: a tile with
summaries in the groups layout, any other in the records layout.new_summary_table_block() and new_summarize_table_block() are
superseded: they translate their arguments and return a table block in
the variables and the groups layout.lane_chart_block and rank_block. blockr.core 0.1.4
restores a block whose classes differ from the saved ones, so a saved
summarize table loads as a table block. Boards saved under the older
names new_lane_chart_block() and new_rank_block() restore the same
way.new_picker_block() is deprecated and warns. It stays so that boards
saved with it restore with the block and its links. Bind chart and table
mappings to the source columns and put a group switch in the board's
filter instead.register_viz_exporter() adds a
format, and a block offers every registered format that can write it.
blockr.viz registers Excel, a web page, an image and PowerPoint; a block
hands its downloads an exhibit (new_viz_exhibit()).drill_target the view follows the click or
brush the chart sent, until the reader clicks the same mark again, which
also clears the target; what other blocks send to the target leaves it in
place. Before, a second click sent the same drill again. With drill unset a scatter
brush filters nothing downstream, but the data view shows the points it
caught. A selection on the outer key alone (drill = "ARM" on a bar
coloured by SEX) lights its group in Summary.page_size
and sorted on the server. Summary stays the table view, for its row
clicks and row groups.options(blockr.locked = TRUE)) the blocks take no
settings from the browser; clicks still filter.script) runs R code on the server, so the browser
can set it only with options(blockr.viz.browser_script = TRUE). Code and
saved boards set it as before.R/legacy.R and R/legacy-restore.R keep what older code and boards need,
and nothing else does. They go when the support for blockr.viz before 0.3.0
goes.
chart_type and baseline are type, group is
category, metric is value, agg_fn is func, bar_mode is
position, tt_fields is tooltip, line_width_mult and
dot_size_mult are line_width and point_size, lo and hi are
ymin and ymax, band_id and count_col
are id, count_on is show_n, na_group is missing, pct_of is
percent_of, ref_lo and ref_hi are ref_min and ref_max,
y_scale and x_scale are y_transform and x_transform,
direct_labels is legend = "marks", ctrl_target and ctrl_table
are drill_target and drill_table, values is script_values, and
the filter_* fields are selection. func_toggle is dropped.value = ".count" is a row count (value unset);
type = "radar" becomes a bar chart, with a warning;
baseline = "cumulative" on a bar is type = "waterfall"; bar_mode
"stacked", "grouped" and "percent" are position "stack",
"dodge" and "fill"; pct_of = "group" is "category"; y_scale
and x_scale "linear" and "log" are "identity" and "log10";
show_n = "off" is "none"; connect = "step-start" and its siblings
are "step_start", and connect = "off" is "straight";
box_points = "all" is "none"; "on" and "off" are TRUE and
FALSE. Several percent_of values keep the first.value and values are columns, group is by,
cell_color is shadings, row_color is color, rotate_titles and
compact are look, digits is format, the three *_download
switches are download, ctrl_target and ctrl_table are
drill_target and drill_table, the filter_* fields are selection,
pct_of is percent_of, axis is column_axis, and the summary
table's vars, add_overall, overall_label, nest_hierarchies and
id_var are summaries, total, total_label, nest and id.
max_height, indent_details and state are dropped.sort_by = "label" is "alpha", stats = "compact" is
"mean_sd", and an old aggregation list(func, cols) in summaries
becomes one number column per function and column.band is ymin, ref is summary or x_lines,
ref_lo, ref_hi, lo and hi are ref_min and ref_max, dash is
linetype, from and to are x and xend, from_func and
to_func are x_func and xend_func, fields is tooltip, stat
and inner are summary, outer is whiskers, style is show
("dot" is "pointrange"), denom is id, type = "series" is
"sparkline", ref = "median_iqr" is "median_q1_q3", and position
"stacked", "grouped" and "percent" are "stack", "dodge" and
"fill". scope, parent and facet_order are dropped.cols is columns and type is mode. palette and
source are dropped.{@group} becomes {@category}). Tile, summary
table and summarize table blocks restore as table blocks. gt,
drilldown_chart, waterfall and drilldown_table blocks no longer
restore.y_scale = "log" draws a base-10 y axis on a scatter, line or band, and
x_scale = "log" the x axis of a scatter. Ticks run 1-2-5 up to three
decades and at powers of ten beyond. Values and reference lines at or below
zero are not drawn, and the footer counts them; an interval's low end
there is cut at the bottom of the axis. A smoother is fitted on the log
scale. The gear offers "Y scale" and "X scale" next to Unit.highlight makes a few marks of a bar, scatter, line or area stand out:
highlight = list(country = "Switzerland") names one column and some of
its values. Marks holding one of the values keep their colour, every other
mark is grey and drawn behind them. With color the highlighted marks keep
their colour level, the palette is spread over the highlighted levels
only, and the legend lists only those. Highlighted marks are named: in
semibold on a bar's axis, beside a point, at a line's end. A title says it
with {highlight}: "...[, {highlight} highlighted]". The gear offers it
under "Add mapping" as a column and a value picker. A drill selection
still dims by opacity on top.type = "histogram" cuts x into about bins bins (default 30) at
readable breaks and draws them as touching bars, empty bins included. A
click on a bin filters x to its range.type = "area": a line with its area filled, stacked across a colour
split unless position = "dodge", measured from zero.ymin / ymax on a line draw a shaded band, and several columns draw
nested bands, the first the outermost: ymin = c("lo95", "lo80"), ymax = c("hi95", "hi80") is a forecast fan. A single line's band is grey. On a
scatter they stay error bars. A saved line chart with lo / hi now
draws a band instead of error bars.linetype names a column whose values set a line's dash: the first value
is solid, the others dashed, from the last point of the solid part on.shape on a scatter or line names a column whose values set each point's
marker: circle, triangle, diamond, square, rounded square, pin, arrow,
then again, in factor level order, else sorted; a missing value is a
circle. A line shows its points when shape is set, however many lines
there are. The legend band lists the markers after the colour chips.ref_lines on a scatter, line or area names columns holding reference
limits (a normal range, grade thresholds): in each panel, a column with a
value in the panel's rows draws a dashed line at the mean of those values,
labelled with the column's label, else its name, and the panel's y axis
takes it in. ref_line_colors colours them by column
(list(LLN = "#4DAF4A")); the others take the reference red.x_ranges shades named stretches of x (list(Recession = c("2008-01-01", "2009-06-30"))). The gear edits them as one line, "Shaded":
Recession: 2008-01-01 to 2009-06-30; Covid: 2020-03-01 to 2021-06-30.x_lines take dates and category values as well as numbers, as
x_ranges does: x_lines = c(Listed = "2026-10-21"). A Date is placed
on a date axis; before, it landed in 1970 and a date string was dropped.
On a bar, x_lines and x_ranges mark the category axis either way
round: a value names its bar, and on bars over dates a date marks the bar
whose period holds it. The gear writes names the way the shaded ranges
do, Listed: 2026-10-21; 2026-11-02, for y_lines too, so a name set in
code survives an edit.label on a scatter, line or area writes the column's value beside each
point that has one, and the gear offers it under "Add mapping". On a bar,
pie or treemap it writes the value on each bar, slice or tile whose rows
agree on one: at a bar's end, inside a stack's segments where it fits, in
place of a slice's name. Waterfall, histogram, boxplot, pointrange and
radar do not draw it.format also takes a whole number of decimals from 0 to 6 (format = 2
prints 4.36 on the axis, in tooltips and value labels), as on the table
block. The gear's "Numbers" select offers Auto, 0, 1 and 2 decimals beside
compact and percent.format = "number" prints up to two decimals, trailing zeros dropped, and
a value that would round to 0 keeps two significant digits (0.0034), as
the table block. It printed up to four before ("4.3587 %"). Bar value
labels print each value on its own (1.7 next to 2.14).pct_of = "total" takes a pct_distinct denominator over the whole
chart, all panels together. "facet" stays the default.waterfall_totals, picked
from the steps), "Interval low / high" on an area (ymin / ymax) and
"Group counts" on a histogram (show_n).{@type} in a title, subtitle or caption opens a menu of chart types,
narrowed by a list ({@type in line, scatter}).legend places the colour legend: "bottom" (default), "top", "marks"
or "none". "marks" writes the names on the marks (at a line's or an
area's end, beside the last bar of a stack, at a scatter group's centre,
on a pie slice); dodged bars, histograms and boxplots keep the legend.
Names of scatter groups whose centres sit close are moved apart a line at
a time.
The legend is left-aligned, its swatch has the mark's shape (a line, a
dot or a square), and its title names the colour column: its label, else
its name. direct_labels = TRUE, from earlier builds of 0.3.0, is read as
legend = "marks".format ("number", "compact", "percent") and unit print the values
as the table block does: the ticks in the format, the unit once in the axis
title, tooltips and value labels with both.series, a trajectory per subject), hover still
picks the nearest line, without the gradient area and the ring of dots.sort_by orders its categories by the
category column: a date, number or factor keeps its own order (time, size,
levels), and a text column sorts by value, largest first. Before, every
category sorted by value, so quarters and weeks came out of order. When
the gear switches the category, a sort still at one of these defaults
follows the new column. sort_by = "data" puts a date or number in time
or numeric order instead of first appearance, and without sort_dir it
runs ascending (it ran descending before). A chart whose state sets both
sort_by and sort_dir keeps its order.connect defaults to "straight" for new charts. A saved chart keeps the
value it was saved with, so existing boards stay smoothed.new_chart_block() has new argument names, chosen to stay stable on CRAN
and to match blockr.ggplot and ggplot2. x and y are the screen axes for
every type: a horizontal bar of counts is y = "class", a horizontal bar
of sums x = "sales", y = "region", func = "sum". orientation is
inferred and only needed when both columns are non-numeric. The renames:
chart_type -> type, group/value -> x/y, bar_mode ->
position ("stack", "dodge", "fill"), tt_fields -> tooltip,
line_width_mult/dot_size_mult -> line_width/point_size,
value_lines -> y_lines, lo/hi -> ymin/ymax, band_id and
count_col -> id, count_on -> show_n, na_group -> missing,
ctrl_target/ctrl_table -> drill_target/drill_table, values ->
script_values, and the four filter_* fields -> selection.
pct_of = "group" is now "category". baseline = "cumulative" is
type = "waterfall", and type = "radar" is gone. The old names still
work, with a warning, and saved boards load unchanged.{@arg} slots in titles take the new names ({@type}, {label(@y)}). A
saved template with an old name still resolves.--blockr-mark-font-size; the fallback follows).y_lines line at 0 has no label: the axis prints 0.interactive_table() draws a table the way the table block does, for
another block's UI, and update_interactive_table() replaces the table
inside it from the server. It replaces drilldown_table(), which is no
longer exported. static_table() is the print counterpart.look = "compact") and tiles (look = "cards").
A saved tile block loads as a table block.sort_by = "alpha", as
the chart block does. The old value "label" is read as "alpha".format takes the chart block's values: "number",
"compact" (1.2K, 3.4M), "percent" (a fraction x100 with "%") or a
whole number of decimals from 0 to 6. A new unit heads the numeric
columns ("Revenue (CHF)") and follows the number on a card. Both apply to
the records layout's cells, cards and downloads; the gear's "Numbers"
select and "Unit" field set them. Excel keeps the values as numbers and
shows them in the same format.format = 2 gives
4.30), so a column lines up; Excel formats every numeric column with it.
"number" prints up to two decimals, and a value that would round to 0
keeps two significant digits (0.0034). An old digits = 2, the old
default, reads as "number".format and unit reach the groups layout too: its number cells, the
value labels beside its bars and its cards. unit heads the columns that
are not counts. The variables layout (Table 1) keeps its statistics' own
formats. The groups gear has the same "Numbers" and "Unit" controls.drill_target) from a missing bar, or
from a table's "(Missing)" row, claims the rows with no value: the claim
carries the value filter's "<NA>" / "<empty>" tokens, and with the
board's subject column it is the subjects behind those rows. Before, it
claimed nothing.missing = "level" gives
the rows whose value is missing, in every layout. Before, it gave none.
summary_table() and table_nest() take missing: the variables layout
keeps a numeric variable numeric when it has missing values, and a nested
records table names its missing group "(Missing)", a header a drill can
claim.missing defaults to "level", as on the chart block:
missing values of a grouping, colour or facet column show as "(Missing)"
unless the author drops them. A board saved by the new table block stored
its missing and keeps it. Boards saved by the old table, summarize table
and summary table blocks had no missing; they now show "(Missing)" rows
and columns where their data has missing values.download = TRUE), as
the chart block does. Boards saved by the new table block stored their
choice and keep it. An old table board keeps downloads off when it stored
its per-format download flags all off; one saved before those flags
existed now offers downloads.summary and whiskers are typed in the block's
argument specs: the chart's statistics (median_q1_q3, mean_sd, ...,
whiskers also tukey), plus mean_ci95 and "none", which only the
table draws.group and parent become by, and func, value, id_var,
color, facet and bar_mode become the column's own settings.by columns lists the inner column flat
when the outer one has no value in any row. A prepare script can blank the
outer column behind a flag (soc <- FALSE, AEBODSYS = if (soc) AEBODSYS else NA) and name the flag in the subtitle ([ within {@soc}]), so the
reader switches the nesting on and off from the sentence. Before, such a
table drew no rows.top_n prints in {@top_n} and the word
opens the script's control, although the table has a top_n setting of
its own. The setting keeps its row in the gear, and the Titles tab names
the word's owner. Before, the setting won, and an AE heatmap restored as a
table printed nothing for {@top_n}.value_labels,
default on). Off drops every number printed beside a mark.AEBODSYS = CARDIAC), a child row
both columns (AEBODSYS = SKIN, AEDECOD = RASH), for the downstream filter
and for a drill sent to another block. Before, every row claimed the inner
column, so a parent row matched nothing and a child label found under
several parents claimed it under all of them. The gear's Drill-down section
is an on/off switch now; its column picker is gone. Boards saved with a
single-column click restore it as before.ctrl_target) now carries every value the click
names. A click on a bar segment that covers nine patients drills the patient
profile to those nine; before, a drill naming more than one value reached
the target as nothing.lane_chart_block and rank_block
again. Dropping them in 0.2.194 made every saved board with a summarize
table fail to open ("Could not deserialize object: expected classes ...").new_rank_block() and new_lane_chart_block(), the summarize
table's former names. Use new_summarize_table_block().rank_table() is no longer exported. The summarize table's static HTML is
html_exhibit(static_summarize_table(...)).R/summarize-*.R, inst/js/summarize-table.js), functions, CSS
classes and variables (blockr-summarize-*), HTML attributes
(data-summarize-*) and the custom message names. Custom CSS that targeted
.blockr-rank-* needs the new names.inst/js/chart.js is
replaced by separate model, option and view files in inst/js/chart/.
Clicks follow the documented rules: a click always sends its filter and
never toggles it off (Reset clears); a coloured segment, a facet panel
and a scatter point's series filter what they show; a legend chip
filters its level instead of hiding it; a brush takes the brushed points;
the footer names the filter in column labels; a restored or latched
filter, a range included, lights what holds filtered rows and dims the
rest.static_chart(), chart_expr(),
chart_code() and the chart block's report_call() method. Chart
downloads (png, web page, PowerPoint) carry the picture the browser drew.
The Excel download writes the rows the chart is drawn from.BLOCKR_CANVAS_CAPTURE,
options(blockr.viz.canvas_capture)). Chart, heatmap and rank blocks
always export the captured picture.