From a7f3856b6b3b231de3f4c93c2b76f87be5bab78c Mon Sep 17 00:00:00 2001 From: gururaj1512 Date: Mon, 9 Nov 2026 23:51:59 +0530 Subject: [PATCH 1/2] docs: add figure SVGs --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: skipped - task: lint_markdown_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/plot/vega/title/ctor/docs/img/figure_title.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_align_center.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_align_left.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_anchor_end.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_anchor_middle.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_anchor_start.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_angle_0.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_angle_180.svg | 1 + .../vega/title/ctor/docs/img/figure_title_baseline_bottom.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_baseline_top.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_color_red.svg | 1 + .../vega/title/ctor/docs/img/figure_title_color_steelblue.svg | 1 + .../@stdlib/plot/vega/title/ctor/docs/img/figure_title_dx_0.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_dx_100.svg | 1 + .../@stdlib/plot/vega/title/ctor/docs/img/figure_title_dy_0.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_dy_100.svg | 1 + .../vega/title/ctor/docs/img/figure_title_font_monospace.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_font_serif.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_fontsize_12.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_fontsize_20.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_fontsize_28.svg | 1 + .../vega/title/ctor/docs/img/figure_title_fontstyle_italic.svg | 1 + .../vega/title/ctor/docs/img/figure_title_fontstyle_normal.svg | 1 + .../vega/title/ctor/docs/img/figure_title_fontweight_bold.svg | 1 + .../vega/title/ctor/docs/img/figure_title_fontweight_normal.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_frame_bounds.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_frame_group.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_limit_200.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_limit_none.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_lineheight_20.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_lineheight_40.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_offset_0.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_offset_30.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_orient_bottom.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_orient_top.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_subtitle.svg | 1 + .../title/ctor/docs/img/figure_title_subtitle_color_blue.svg | 1 + .../title/ctor/docs/img/figure_title_subtitle_font_monospace.svg | 1 + .../title/ctor/docs/img/figure_title_subtitle_font_serif.svg | 1 + .../title/ctor/docs/img/figure_title_subtitle_fontsize_10.svg | 1 + .../title/ctor/docs/img/figure_title_subtitle_fontsize_18.svg | 1 + .../ctor/docs/img/figure_title_subtitle_fontstyle_italic.svg | 1 + .../ctor/docs/img/figure_title_subtitle_fontstyle_normal.svg | 1 + .../ctor/docs/img/figure_title_subtitle_fontweight_bold.svg | 1 + .../ctor/docs/img/figure_title_subtitle_fontweight_normal.svg | 1 + .../title/ctor/docs/img/figure_title_subtitle_lineheight_10.svg | 1 + .../title/ctor/docs/img/figure_title_subtitle_lineheight_30.svg | 1 + .../vega/title/ctor/docs/img/figure_title_subtitle_padding_0.svg | 1 + .../title/ctor/docs/img/figure_title_subtitle_padding_20.svg | 1 + .../@stdlib/plot/vega/title/ctor/docs/img/figure_title_text.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_zindex_0.svg | 1 + .../plot/vega/title/ctor/docs/img/figure_title_zindex_2.svg | 1 + 52 files changed, 52 insertions(+) create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_align_center.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_align_left.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_end.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_middle.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_start.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_angle_0.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_angle_180.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_baseline_bottom.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_baseline_top.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_color_red.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_color_steelblue.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dx_0.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dx_100.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dy_0.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dy_100.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_font_monospace.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_font_serif.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_12.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_20.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_28.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontstyle_italic.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontstyle_normal.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontweight_bold.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontweight_normal.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_frame_bounds.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_frame_group.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_limit_200.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_limit_none.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_lineheight_20.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_lineheight_40.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_offset_0.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_offset_30.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_orient_bottom.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_orient_top.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_color_blue.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_font_monospace.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_font_serif.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontsize_10.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontsize_18.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontstyle_italic.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontstyle_normal.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontweight_bold.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontweight_normal.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_lineheight_10.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_lineheight_30.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_padding_0.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_padding_20.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_text.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_zindex_0.svg create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_zindex_2.svg diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title.svg new file mode 100644 index 0000000000000..991cca18edc13 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title.svg @@ -0,0 +1 @@ +012345678910Month0102030405060708090100Revenue ($K)Monthly RevenueFiscal Year 2025 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_align_center.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_align_center.svg new file mode 100644 index 0000000000000..15d64d5301d5d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_align_center.svg @@ -0,0 +1 @@ +Title Textcenter title alignment \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_align_left.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_align_left.svg new file mode 100644 index 0000000000000..89e9221cea724 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_align_left.svg @@ -0,0 +1 @@ +Title Textleft title alignment \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_end.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_end.svg new file mode 100644 index 0000000000000..14d1dc3111746 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_end.svg @@ -0,0 +1 @@ +anchor: end \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_middle.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_middle.svg new file mode 100644 index 0000000000000..8fab7cb5734de --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_middle.svg @@ -0,0 +1 @@ +anchor: middle \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_start.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_start.svg new file mode 100644 index 0000000000000..a55b03e0cfa17 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_start.svg @@ -0,0 +1 @@ +anchor: start \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_angle_0.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_angle_0.svg new file mode 100644 index 0000000000000..a3870a5c88f6d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_angle_0.svg @@ -0,0 +1 @@ +Title Text \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_angle_180.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_angle_180.svg new file mode 100644 index 0000000000000..9600a2b9662f6 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_angle_180.svg @@ -0,0 +1 @@ +Title Text \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_baseline_bottom.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_baseline_bottom.svg new file mode 100644 index 0000000000000..5411818cdfc9a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_baseline_bottom.svg @@ -0,0 +1 @@ +baseline: bottom \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_baseline_top.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_baseline_top.svg new file mode 100644 index 0000000000000..1a8a82ab3682f --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_baseline_top.svg @@ -0,0 +1 @@ +baseline: top \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_color_red.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_color_red.svg new file mode 100644 index 0000000000000..3dff5d1a22609 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_color_red.svg @@ -0,0 +1 @@ +Title Text \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_color_steelblue.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_color_steelblue.svg new file mode 100644 index 0000000000000..3db5c297a4762 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_color_steelblue.svg @@ -0,0 +1 @@ +Title Text \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dx_0.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dx_0.svg new file mode 100644 index 0000000000000..94e58f8f8d950 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dx_0.svg @@ -0,0 +1 @@ +dx: 0 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dx_100.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dx_100.svg new file mode 100644 index 0000000000000..b1245d016adc7 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dx_100.svg @@ -0,0 +1 @@ +dx: 100 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dy_0.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dy_0.svg new file mode 100644 index 0000000000000..2dfb0f3ce191d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dy_0.svg @@ -0,0 +1 @@ +dy: 0 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dy_100.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dy_100.svg new file mode 100644 index 0000000000000..105425784aaf0 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dy_100.svg @@ -0,0 +1 @@ +dy: 100 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_font_monospace.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_font_monospace.svg new file mode 100644 index 0000000000000..c79744e3a2d48 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_font_monospace.svg @@ -0,0 +1 @@ +Monospace Font Title \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_font_serif.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_font_serif.svg new file mode 100644 index 0000000000000..9d1607c6576c6 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_font_serif.svg @@ -0,0 +1 @@ +Serif Font Title \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_12.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_12.svg new file mode 100644 index 0000000000000..cf719b687454d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_12.svg @@ -0,0 +1 @@ +fontSize: 12 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_20.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_20.svg new file mode 100644 index 0000000000000..1386770be2d90 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_20.svg @@ -0,0 +1 @@ +fontSize: 20 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_28.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_28.svg new file mode 100644 index 0000000000000..29b6ec1779c88 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_28.svg @@ -0,0 +1 @@ +fontSize: 28 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontstyle_italic.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontstyle_italic.svg new file mode 100644 index 0000000000000..5e30fe06b9aa1 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontstyle_italic.svg @@ -0,0 +1 @@ +Italic Style Title \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontstyle_normal.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontstyle_normal.svg new file mode 100644 index 0000000000000..696e4f8b803d9 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontstyle_normal.svg @@ -0,0 +1 @@ +Normal Style Title \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontweight_bold.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontweight_bold.svg new file mode 100644 index 0000000000000..a33adeeaced15 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontweight_bold.svg @@ -0,0 +1 @@ +Bold Weight Title \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontweight_normal.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontweight_normal.svg new file mode 100644 index 0000000000000..276504d7fc6a4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontweight_normal.svg @@ -0,0 +1 @@ +Normal Weight Title \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_frame_bounds.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_frame_bounds.svg new file mode 100644 index 0000000000000..9c5b7dd83b4da --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_frame_bounds.svg @@ -0,0 +1 @@ +050100Y Axisframe: bounds \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_frame_group.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_frame_group.svg new file mode 100644 index 0000000000000..afc76f7549eff --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_frame_group.svg @@ -0,0 +1 @@ +050100Y Axisframe: group \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_limit_200.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_limit_200.svg new file mode 100644 index 0000000000000..a7e9b376e7ccb --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_limit_200.svg @@ -0,0 +1 @@ +A Very Long Ti… \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_limit_none.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_limit_none.svg new file mode 100644 index 0000000000000..7c018e43d9f68 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_limit_none.svg @@ -0,0 +1 @@ +A Very Long Title That Shows Without Limit \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_lineheight_20.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_lineheight_20.svg new file mode 100644 index 0000000000000..aad25962b3453 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_lineheight_20.svg @@ -0,0 +1 @@ +First LineSecond Line \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_lineheight_40.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_lineheight_40.svg new file mode 100644 index 0000000000000..41fa976bf7203 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_lineheight_40.svg @@ -0,0 +1 @@ +First LineSecond Line \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_offset_0.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_offset_0.svg new file mode 100644 index 0000000000000..02425234b4b4a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_offset_0.svg @@ -0,0 +1 @@ +offset: 0 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_offset_30.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_offset_30.svg new file mode 100644 index 0000000000000..cfebfba1e5b7c --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_offset_30.svg @@ -0,0 +1 @@ +offset: 30 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_orient_bottom.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_orient_bottom.svg new file mode 100644 index 0000000000000..4ba72e1564d35 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_orient_bottom.svg @@ -0,0 +1 @@ +orient: bottom \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_orient_top.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_orient_top.svg new file mode 100644 index 0000000000000..a000178b29c87 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_orient_top.svg @@ -0,0 +1 @@ +orient: top \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle.svg new file mode 100644 index 0000000000000..34c2237aadeaf --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle.svg @@ -0,0 +1 @@ +Title TextThis is the subtitle text \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_color_blue.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_color_blue.svg new file mode 100644 index 0000000000000..c95d5ae83fb27 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_color_blue.svg @@ -0,0 +1 @@ +Title TextThis is the subtitle text \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_font_monospace.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_font_monospace.svg new file mode 100644 index 0000000000000..5031d546fadf4 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_font_monospace.svg @@ -0,0 +1 @@ +Title TextSubtitle in monospace font \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_font_serif.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_font_serif.svg new file mode 100644 index 0000000000000..d592ec5e8fd7f --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_font_serif.svg @@ -0,0 +1 @@ +Title TextSubtitle in serif font \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontsize_10.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontsize_10.svg new file mode 100644 index 0000000000000..46fa230099917 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontsize_10.svg @@ -0,0 +1 @@ +Title TextsubtitleFontSize: 10 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontsize_18.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontsize_18.svg new file mode 100644 index 0000000000000..35cdf277bf925 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontsize_18.svg @@ -0,0 +1 @@ +Title TextsubtitleFontSize: 18 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontstyle_italic.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontstyle_italic.svg new file mode 100644 index 0000000000000..eba2b09db8872 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontstyle_italic.svg @@ -0,0 +1 @@ +Title TextItalic style subtitle \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontstyle_normal.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontstyle_normal.svg new file mode 100644 index 0000000000000..61e0f7a0dd188 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontstyle_normal.svg @@ -0,0 +1 @@ +Title TextNormal style subtitle \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontweight_bold.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontweight_bold.svg new file mode 100644 index 0000000000000..7b9b514ba6d4a --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontweight_bold.svg @@ -0,0 +1 @@ +Title TextBold weight subtitle \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontweight_normal.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontweight_normal.svg new file mode 100644 index 0000000000000..8c262b8983d58 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontweight_normal.svg @@ -0,0 +1 @@ +Title TextNormal weight subtitle \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_lineheight_10.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_lineheight_10.svg new file mode 100644 index 0000000000000..d1dbd966dfb7d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_lineheight_10.svg @@ -0,0 +1 @@ +Title TextFirst subtitle lineSecond subtitle line \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_lineheight_30.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_lineheight_30.svg new file mode 100644 index 0000000000000..8d68f2e30e809 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_lineheight_30.svg @@ -0,0 +1 @@ +Title TextFirst subtitle lineSecond subtitle line \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_padding_0.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_padding_0.svg new file mode 100644 index 0000000000000..f6ce16fb88ac9 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_padding_0.svg @@ -0,0 +1 @@ +Title TextsubtitlePadding: 0 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_padding_20.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_padding_20.svg new file mode 100644 index 0000000000000..f972a7b3916a6 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_padding_20.svg @@ -0,0 +1 @@ +Title TextsubtitlePadding: 20 \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_text.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_text.svg new file mode 100644 index 0000000000000..a3870a5c88f6d --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_text.svg @@ -0,0 +1 @@ +Title Text \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_zindex_0.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_zindex_0.svg new file mode 100644 index 0000000000000..b29884acfca59 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_zindex_0.svg @@ -0,0 +1 @@ +Title Text (zindex: 0) \ No newline at end of file diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_zindex_2.svg b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_zindex_2.svg new file mode 100644 index 0000000000000..dfab88d9a0a54 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_zindex_2.svg @@ -0,0 +1 @@ +Title Text (zindex: 2) \ No newline at end of file From a8cdf8f9660f56217f3cf2afc1239063de0476f9 Mon Sep 17 00:00:00 2001 From: gururaj1512 Date: Mon, 9 Nov 2026 23:59:47 +0530 Subject: [PATCH 2/2] docs: update README and add figure generation script --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: skipped - task: lint_markdown_pkg_readmes status: passed - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/plot/vega/title/ctor/README.md | 994 ++++++++++++++---- .../vega/title/ctor/srv/scripts/fig_title.js | 885 ++++++++++++++++ 2 files changed, 1694 insertions(+), 185 deletions(-) create mode 100644 lib/node_modules/@stdlib/plot/vega/title/ctor/srv/scripts/fig_title.js diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/README.md b/lib/node_modules/@stdlib/plot/vega/title/ctor/README.md index 36509ae8e2f55..cc35424efd80a 100644 --- a/lib/node_modules/@stdlib/plot/vega/title/ctor/README.md +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/README.md @@ -26,6 +26,8 @@ limitations under the License.
+A title configuration defines the text label placed along the edge of a chart. It supports a primary title and an optional subtitle, along with extensive styling options such as font, color, alignment, and orientation. +
@@ -47,51 +49,58 @@ Returns a title instance. ```javascript var title = new Title(); // returns -``` - -The constructor accepts the following `options`: - -- **align**: horizontal text alignment of the title and subtitle -- **anchor**: anchor position for placing the title and subtitle Default: `'middle'`. -- **angle**: angle (in degrees) of the title and subtitle text -- **aria**: boolean indicating whether ARIA attributes should be included in SVG output Default: `true`. -- **baseline**: vertical baseline of the title and subtitle text -- **color**: color of the title text -- **dx**: horizontal offset (in pixels) added to the title and subtitle x-coordinate -- **dy**: vertical offset (in pixels) added to the title and subtitle y-coordinate -- **encode**: mark encodings for custom title styling -- **font**: font name of the title text -- **fontSize**: font size of the title text -- **fontStyle**: font style of the title text -- **fontWeight**: font weight of the title text -- **frame**: reference frame for the anchor position Default: `'bounds'`. -- **limit**: maximum allowed length (in pixels) of title and subtitle text -- **lineHeight**: line height for multi-line title text -- **offset**: orthogonal offset (in pixels) by which to displace the title from its position along the edge of the chart -- **orient**: title orientation Default: `'top'`. -- **subtitle**: subtitle text -- **subtitleColor**: color of the subtitle text -- **subtitleFont**: font name for the subtitle text -- **subtitleFontSize**: font size for the subtitle text -- **subtitleFontStyle**: font style for the subtitle text -- **subtitleFontWeight**: font weight for the subtitle text -- **subtitleLineHeight**: line height for multi-line subtitle text -- **subtitlePadding**: padding (in pixels) between title and subtitle text -- **text**: title text Default: `[]`. -- **zindex**: integer z-index indicating the layering of the title group relative to other axis, mark, and legend groups Default: `0`. -```javascript -var title = new Title({ - 'text': 'Beep boop', - 'anchor': 'start', - 'orient': 'bottom' +title = new Title({ + 'text': 'Monthly Revenue', + 'subtitle': 'Fiscal Year 2025', + 'anchor': 'middle', + 'fontSize': 18, + 'subtitleFontSize': 13, + 'subtitleColor': '#888' }); // returns <Title> - -var v = title.text; -// returns [ 'Beep boop' ] ``` +<!-- <figure class="figure" align="center" label="fig:title" src="./docs/img/figure_title.svg" alt="A visualization showing a chart title with subtitle, font size, and color options."> --> + +<div class="figure" align="center" data-figure="fig:title"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title.svg" alt="A visualization showing a chart title with subtitle, font size, and color options."> + <br> +</div> + +<!-- </figure> --> + +The constructor accepts the following options: + +- **align**: horizontal text alignment of the title and subtitle. +- **anchor**: anchor position for placing the title and subtitle. Default: `'middle'`. +- **angle**: angle (in degrees) of the title and subtitle text. +- **aria**: boolean indicating whether ARIA attributes should be included in SVG output. Default: `true`. +- **baseline**: vertical baseline of the title and subtitle text. +- **color**: color of the title text. +- **dx**: horizontal offset (in pixels) added to the title and subtitle x-coordinate. +- **dy**: vertical offset (in pixels) added to the title and subtitle y-coordinate. +- **encode**: mark encodings for custom title styling. +- **font**: font name of the title text. +- **fontSize**: font size of the title text. +- **fontStyle**: font style of the title text. +- **fontWeight**: font weight of the title text. +- **frame**: reference frame for the anchor position. Default: `'bounds'`. +- **limit**: maximum allowed length (in pixels) of title and subtitle text. +- **lineHeight**: line height for multi-line title text. +- **offset**: orthogonal offset (in pixels) by which to displace the title from its position along the edge of the chart. +- **orient**: title orientation. Default: `'top'`. +- **subtitle**: subtitle text. +- **subtitleColor**: color of the subtitle text. +- **subtitleFont**: font name for the subtitle text. +- **subtitleFontSize**: font size for the subtitle text. +- **subtitleFontStyle**: font style for the subtitle text. +- **subtitleFontWeight**: font weight for the subtitle text. +- **subtitleLineHeight**: line height for multi-line subtitle text. +- **subtitlePadding**: padding (in pixels) between title and subtitle text. +- **text**: title text. Default: `[]`. +- **zindex**: integer z-index indicating the layering of the title group relative to other axis, mark, and legend groups. Default: `0`. + * * * ### Writable Properties @@ -103,16 +112,42 @@ var v = title.text; Horizontal text alignment of the title and subtitle. ```javascript -var title = new Title(); - -// Set: -title.align = 'left'; +var title = new Title({ + 'text': 'Title Text', + 'subtitle': 'left title alignment', + 'subtitleFontStyle': 'italic', + 'subtitleFontSize': 12, + 'align': 'left', + 'fontSize': 16 +}); -// Get: var v = title.align; // returns 'left' + +title.align = 'center'; + +v = title.align; +// returns 'center' ``` +<!-- <figure class="figure" align="center" label="fig:title_align_left" src="./docs/img/figure_title_align_left.svg" alt="Title with align set to left."> --> + +<div class="figure" align="center" data-figure="fig:title_align_left"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_align_left.svg" alt="Title with align set to left."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_align_center" src="./docs/img/figure_title_align_center.svg" alt="Title with align set to center."> --> + +<div class="figure" align="center" data-figure="fig:title_align_center"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_align_center.svg" alt="Title with align set to center."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-anchor"></a> #### Title.prototype.anchor @@ -120,16 +155,53 @@ var v = title.align; Anchor position for placing the title and subtitle. Default: `'middle'`. ```javascript -var title = new Title(); - -// Set: -title.anchor = 'start'; +var title = new Title({ + 'text': 'anchor: start', + 'anchor': 'start', + 'fontSize': 16 +}); -// Get: var v = title.anchor; // returns 'start' + +title.anchor = 'middle'; + +v = title.anchor; +// returns 'middle' + +title.anchor = 'end'; + +v = title.anchor; +// returns 'end' ``` +<!-- <figure class="figure" align="center" label="fig:title_anchor_start" src="./docs/img/figure_title_anchor_start.svg" alt="Title with anchor set to start."> --> + +<div class="figure" align="center" data-figure="fig:title_anchor_start"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_start.svg" alt="Title with anchor set to start."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_anchor_middle" src="./docs/img/figure_title_anchor_middle.svg" alt="Title with anchor set to middle."> --> + +<div class="figure" align="center" data-figure="fig:title_anchor_middle"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_middle.svg" alt="Title with anchor set to middle."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_anchor_end" src="./docs/img/figure_title_anchor_end.svg" alt="Title with anchor set to end."> --> + +<div class="figure" align="center" data-figure="fig:title_anchor_end"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_anchor_end.svg" alt="Title with anchor set to end."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-angle"></a> #### Title.prototype.angle @@ -137,16 +209,39 @@ var v = title.anchor; Angle (in degrees) of the title and subtitle text. ```javascript -var title = new Title(); - -// Set: -title.angle = 90; +var title = new Title({ + 'text': 'Title Text', + 'angle': 0, + 'fontSize': 16 +}); -// Get: var v = title.angle; -// returns 90 +// returns 0 + +title.angle = 180; + +v = title.angle; +// returns 180 ``` +<!-- <figure class="figure" align="center" label="fig:title_angle_0" src="./docs/img/figure_title_angle_0.svg" alt="Title with angle set to 0 degrees."> --> + +<div class="figure" align="center" data-figure="fig:title_angle_0"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_angle_0.svg" alt="Title with angle set to 0 degrees."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_angle_180" src="./docs/img/figure_title_angle_180.svg" alt="Title with angle set to 180 degrees."> --> + +<div class="figure" align="center" data-figure="fig:title_angle_180"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_angle_180.svg" alt="Title with angle set to 180 degrees."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-aria"></a> #### Title.prototype.aria @@ -156,11 +251,12 @@ Boolean indicating whether ARIA attributes should be included in SVG output. Def ```javascript var title = new Title(); -// Set: +var v = title.aria; +// returns true + title.aria = false; -// Get: -var v = title.aria; +v = title.aria; // returns false ``` @@ -171,16 +267,39 @@ var v = title.aria; Vertical baseline of the title and subtitle text. ```javascript -var title = new Title(); - -// Set: -title.baseline = 'top'; +var title = new Title({ + 'text': 'baseline: top', + 'baseline': 'top', + 'fontSize': 16 +}); -// Get: var v = title.baseline; // returns 'top' + +title.baseline = 'bottom'; + +v = title.baseline; +// returns 'bottom' ``` +<!-- <figure class="figure" align="center" label="fig:title_baseline_top" src="./docs/img/figure_title_baseline_top.svg" alt="Title with baseline set to top."> --> + +<div class="figure" align="center" data-figure="fig:title_baseline_top"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_baseline_top.svg" alt="Title with baseline set to top."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_baseline_bottom" src="./docs/img/figure_title_baseline_bottom.svg" alt="Title with baseline set to bottom."> --> + +<div class="figure" align="center" data-figure="fig:title_baseline_bottom"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_baseline_bottom.svg" alt="Title with baseline set to bottom."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-color"></a> #### Title.prototype.color @@ -188,16 +307,39 @@ var v = title.baseline; Color of the title text. ```javascript -var title = new Title(); - -// Set: -title.color = 'steelblue'; +var title = new Title({ + 'text': 'Title Text', + 'color': 'steelblue', + 'fontSize': 16 +}); -// Get: var v = title.color; // returns 'steelblue' + +title.color = '#e74c3c'; + +v = title.color; +// returns '#e74c3c' ``` +<!-- <figure class="figure" align="center" label="fig:title_color_steelblue" src="./docs/img/figure_title_color_steelblue.svg" alt="Title with color set to steelblue."> --> + +<div class="figure" align="center" data-figure="fig:title_color_steelblue"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_color_steelblue.svg" alt="Title with color set to steelblue."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_color_red" src="./docs/img/figure_title_color_red.svg" alt="Title with color set to red (#e74c3c)."> --> + +<div class="figure" align="center" data-figure="fig:title_color_red"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_color_red.svg" alt="Title with color set to red (#e74c3c)."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-dx"></a> #### Title.prototype.dx @@ -205,16 +347,40 @@ var v = title.color; Horizontal offset (in pixels) added to the title and subtitle x-coordinate. ```javascript -var title = new Title(); - -// Set: -title.dx = 2; +var title = new Title({ + 'text': 'dx: 0', + 'dx': 0, + 'anchor': 'start', + 'fontSize': 16 +}); -// Get: var v = title.dx; -// returns 2 +// returns 0 + +title.dx = 100; + +v = title.dx; +// returns 100 ``` +<!-- <figure class="figure" align="center" label="fig:title_dx_0" src="./docs/img/figure_title_dx_0.svg" alt="Title with dx set to 0."> --> + +<div class="figure" align="center" data-figure="fig:title_dx_0"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dx_0.svg" alt="Title with dx set to 0."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_dx_100" src="./docs/img/figure_title_dx_100.svg" alt="Title with dx set to 100."> --> + +<div class="figure" align="center" data-figure="fig:title_dx_100"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dx_100.svg" alt="Title with dx set to 100."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-dy"></a> #### Title.prototype.dy @@ -222,16 +388,39 @@ var v = title.dx; Vertical offset (in pixels) added to the title and subtitle y-coordinate. ```javascript -var title = new Title(); - -// Set: -title.dy = 2; +var title = new Title({ + 'text': 'dy: 0', + 'dy': 0, + 'fontSize': 16 +}); -// Get: var v = title.dy; -// returns 2 +// returns 0 + +title.dy = 100; + +v = title.dy; +// returns 100 ``` +<!-- <figure class="figure" align="center" label="fig:title_dy_0" src="./docs/img/figure_title_dy_0.svg" alt="Title with dy set to 0."> --> + +<div class="figure" align="center" data-figure="fig:title_dy_0"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dy_0.svg" alt="Title with dy set to 0."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_dy_100" src="./docs/img/figure_title_dy_100.svg" alt="Title with dy set to 100."> --> + +<div class="figure" align="center" data-figure="fig:title_dy_100"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_dy_100.svg" alt="Title with dy set to 100."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-encode"></a> #### Title.prototype.encode @@ -241,7 +430,9 @@ Mark encodings for custom title styling. ```javascript var title = new Title(); -// Set: +var v = title.encode; +// returns undefined + title.encode = { 'title': { 'enter': { @@ -252,8 +443,7 @@ title.encode = { } }; -// Get: -var v = title.encode; +v = title.encode; // returns {...} ``` @@ -264,16 +454,39 @@ var v = title.encode; Font name of the title text. ```javascript -var title = new Title(); - -// Set: -title.font = 'Arial'; +var title = new Title({ + 'text': 'Serif Font Title', + 'font': 'serif', + 'fontSize': 16 +}); -// Get: var v = title.font; -// returns 'Arial' +// returns 'serif' + +title.font = 'monospace'; + +v = title.font; +// returns 'monospace' ``` +<!-- <figure class="figure" align="center" label="fig:title_font_serif" src="./docs/img/figure_title_font_serif.svg" alt="Title with font set to serif."> --> + +<div class="figure" align="center" data-figure="fig:title_font_serif"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_font_serif.svg" alt="Title with font set to serif."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_font_monospace" src="./docs/img/figure_title_font_monospace.svg" alt="Title with font set to monospace."> --> + +<div class="figure" align="center" data-figure="fig:title_font_monospace"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_font_monospace.svg" alt="Title with font set to monospace."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-font-size"></a> #### Title.prototype.fontSize @@ -281,16 +494,52 @@ var v = title.font; Font size of the title text. ```javascript -var title = new Title(); - -// Set: -title.fontSize = 12; +var title = new Title({ + 'text': 'fontSize: 12', + 'fontSize': 12 +}); -// Get: var v = title.fontSize; // returns 12 + +title.fontSize = 20; + +v = title.fontSize; +// returns 20 + +title.fontSize = 28; + +v = title.fontSize; +// returns 28 ``` +<!-- <figure class="figure" align="center" label="fig:title_fontsize_12" src="./docs/img/figure_title_fontsize_12.svg" alt="Title with fontSize set to 12."> --> + +<div class="figure" align="center" data-figure="fig:title_fontsize_12"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_12.svg" alt="Title with fontSize set to 12."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_fontsize_20" src="./docs/img/figure_title_fontsize_20.svg" alt="Title with fontSize set to 20."> --> + +<div class="figure" align="center" data-figure="fig:title_fontsize_20"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_20.svg" alt="Title with fontSize set to 20."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_fontsize_28" src="./docs/img/figure_title_fontsize_28.svg" alt="Title with fontSize set to 28."> --> + +<div class="figure" align="center" data-figure="fig:title_fontsize_28"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontsize_28.svg" alt="Title with fontSize set to 28."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-font-style"></a> #### Title.prototype.fontStyle @@ -298,16 +547,39 @@ var v = title.fontSize; Font style of the title text. ```javascript -var title = new Title(); +var title = new Title({ + 'text': 'Normal Style Title', + 'fontStyle': 'normal', + 'fontSize': 16 +}); + +var v = title.fontStyle; +// returns 'normal' -// Set: title.fontStyle = 'italic'; -// Get: -var v = title.fontStyle; +v = title.fontStyle; // returns 'italic' ``` +<!-- <figure class="figure" align="center" label="fig:title_fontstyle_normal" src="./docs/img/figure_title_fontstyle_normal.svg" alt="Title with fontStyle set to normal."> --> + +<div class="figure" align="center" data-figure="fig:title_fontstyle_normal"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontstyle_normal.svg" alt="Title with fontStyle set to normal."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_fontstyle_italic" src="./docs/img/figure_title_fontstyle_italic.svg" alt="Title with fontStyle set to italic."> --> + +<div class="figure" align="center" data-figure="fig:title_fontstyle_italic"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontstyle_italic.svg" alt="Title with fontStyle set to italic."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-font-weight"></a> #### Title.prototype.fontWeight @@ -315,16 +587,39 @@ var v = title.fontStyle; Font weight of the title text. ```javascript -var title = new Title(); +var title = new Title({ + 'text': 'Normal Weight Title', + 'fontWeight': 'normal', + 'fontSize': 16 +}); + +var v = title.fontWeight; +// returns 'normal' -// Set: title.fontWeight = 'bold'; -// Get: -var v = title.fontWeight; +v = title.fontWeight; // returns 'bold' ``` +<!-- <figure class="figure" align="center" label="fig:title_fontweight_normal" src="./docs/img/figure_title_fontweight_normal.svg" alt="Title with fontWeight set to normal."> --> + +<div class="figure" align="center" data-figure="fig:title_fontweight_normal"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontweight_normal.svg" alt="Title with fontWeight set to normal."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_fontweight_bold" src="./docs/img/figure_title_fontweight_bold.svg" alt="Title with fontWeight set to bold."> --> + +<div class="figure" align="center" data-figure="fig:title_fontweight_bold"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_fontweight_bold.svg" alt="Title with fontWeight set to bold."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-frame"></a> #### Title.prototype.frame @@ -332,16 +627,40 @@ var v = title.fontWeight; Reference frame for the anchor position. Default: `'bounds'`. ```javascript -var title = new Title(); +var title = new Title({ + 'text': 'frame: bounds', + 'frame': 'bounds', + 'anchor': 'start', + 'fontSize': 16 +}); + +var v = title.frame; +// returns 'bounds' -// Set: title.frame = 'group'; -// Get: -var v = title.frame; +v = title.frame; // returns 'group' ``` +<!-- <figure class="figure" align="center" label="fig:title_frame_bounds" src="./docs/img/figure_title_frame_bounds.svg" alt="Title with frame set to bounds."> --> + +<div class="figure" align="center" data-figure="fig:title_frame_bounds"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_frame_bounds.svg" alt="Title with frame set to bounds."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_frame_group" src="./docs/img/figure_title_frame_group.svg" alt="Title with frame set to group."> --> + +<div class="figure" align="center" data-figure="fig:title_frame_group"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_frame_group.svg" alt="Title with frame set to group."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-limit"></a> #### Title.prototype.limit @@ -349,16 +668,38 @@ var v = title.frame; Maximum allowed length (in pixels) of title and subtitle text. ```javascript -var title = new Title(); - -// Set: -title.limit = 100; +var title = new Title({ + 'text': 'A Very Long Title That Shows Without Limit', + 'fontSize': 16 +}); -// Get: var v = title.limit; -// returns 100 +// returns undefined + +title.limit = 200; + +v = title.limit; +// returns 200 ``` +<!-- <figure class="figure" align="center" label="fig:title_limit_none" src="./docs/img/figure_title_limit_none.svg" alt="Title with no limit set."> --> + +<div class="figure" align="center" data-figure="fig:title_limit_none"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_limit_none.svg" alt="Title with no limit set."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_limit_200" src="./docs/img/figure_title_limit_200.svg" alt="Title with limit set to 200 pixels."> --> + +<div class="figure" align="center" data-figure="fig:title_limit_200"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_limit_200.svg" alt="Title with limit set to 200 pixels."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-line-height"></a> #### Title.prototype.lineHeight @@ -366,16 +707,39 @@ var v = title.limit; Line height for multi-line title text. ```javascript -var title = new Title(); - -// Set: -title.lineHeight = 2; +var title = new Title({ + 'text': [ 'First Line', 'Second Line' ], + 'lineHeight': 20, + 'fontSize': 16 +}); -// Get: var v = title.lineHeight; -// returns 2 +// returns 20 + +title.lineHeight = 40; + +v = title.lineHeight; +// returns 40 ``` +<!-- <figure class="figure" align="center" label="fig:title_lineheight_20" src="./docs/img/figure_title_lineheight_20.svg" alt="Title with lineHeight set to 20."> --> + +<div class="figure" align="center" data-figure="fig:title_lineheight_20"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_lineheight_20.svg" alt="Title with lineHeight set to 20."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_lineheight_40" src="./docs/img/figure_title_lineheight_40.svg" alt="Title with lineHeight set to 40."> --> + +<div class="figure" align="center" data-figure="fig:title_lineheight_40"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_lineheight_40.svg" alt="Title with lineHeight set to 40."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-offset"></a> #### Title.prototype.offset @@ -383,16 +747,39 @@ var v = title.lineHeight; Orthogonal offset (in pixels) by which to displace the title from its position along the edge of the chart. ```javascript -var title = new Title(); - -// Set: -title.offset = 12; +var title = new Title({ + 'text': 'offset: 0', + 'offset': 0, + 'fontSize': 16 +}); -// Get: var v = title.offset; -// returns 12 +// returns 0 + +title.offset = 30; + +v = title.offset; +// returns 30 ``` +<!-- <figure class="figure" align="center" label="fig:title_offset_0" src="./docs/img/figure_title_offset_0.svg" alt="Title with offset set to 0."> --> + +<div class="figure" align="center" data-figure="fig:title_offset_0"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_offset_0.svg" alt="Title with offset set to 0."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_offset_30" src="./docs/img/figure_title_offset_30.svg" alt="Title with offset set to 30."> --> + +<div class="figure" align="center" data-figure="fig:title_offset_30"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_offset_30.svg" alt="Title with offset set to 30."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-orient"></a> #### Title.prototype.orient @@ -400,16 +787,39 @@ var v = title.offset; Title orientation. Default: `'top'`. ```javascript -var title = new Title(); +var title = new Title({ + 'text': 'orient: top', + 'orient': 'top', + 'fontSize': 16 +}); + +var v = title.orient; +// returns 'top' -// Set: title.orient = 'bottom'; -// Get: -var v = title.orient; +v = title.orient; // returns 'bottom' ``` +<!-- <figure class="figure" align="center" label="fig:title_orient_top" src="./docs/img/figure_title_orient_top.svg" alt="Title with orient set to top."> --> + +<div class="figure" align="center" data-figure="fig:title_orient_top"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_orient_top.svg" alt="Title with orient set to top."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_orient_bottom" src="./docs/img/figure_title_orient_bottom.svg" alt="Title with orient set to bottom."> --> + +<div class="figure" align="center" data-figure="fig:title_orient_bottom"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_orient_bottom.svg" alt="Title with orient set to bottom."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-subtitle"></a> #### Title.prototype.subtitle @@ -417,16 +827,30 @@ var v = title.orient; Subtitle text. ```javascript -var title = new Title(); - -// Set: -title.subtitle = 'foo bar'; +var title = new Title({ + 'text': 'Title Text', + 'fontSize': 16, + 'subtitleFontSize': 12 +}); -// Get: var v = title.subtitle; -// returns [ 'foo bar' ] +// returns undefined + +title.subtitle = 'This is the subtitle text'; + +v = title.subtitle; +// returns [ 'This is the subtitle text' ] ``` +<!-- <figure class="figure" align="center" label="fig:title_subtitle" src="./docs/img/figure_title_subtitle.svg" alt="Title with subtitle set."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle.svg" alt="Title with subtitle set."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-subtitle-color"></a> #### Title.prototype.subtitleColor @@ -434,16 +858,31 @@ var v = title.subtitle; Color of the subtitle text. ```javascript -var title = new Title(); - -// Set: -title.subtitleColor = 'steelblue'; +var title = new Title({ + 'text': 'Title Text', + 'subtitle': 'This is the subtitle text', + 'fontSize': 16, + 'subtitleFontSize': 12 +}); -// Get: var v = title.subtitleColor; -// returns 'steelblue' +// returns undefined + +title.subtitleColor = '#3498db'; + +v = title.subtitleColor; +// returns '#3498db' ``` +<!-- <figure class="figure" align="center" label="fig:title_subtitle_color_blue" src="./docs/img/figure_title_subtitle_color_blue.svg" alt="Title with subtitleColor set to blue (#3498db)."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle_color_blue"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_color_blue.svg" alt="Title with subtitleColor set to blue (#3498db)."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-subtitle-font"></a> #### Title.prototype.subtitleFont @@ -451,16 +890,41 @@ var v = title.subtitleColor; Font name for the subtitle text. ```javascript -var title = new Title(); - -// Set: -title.subtitleFont = 'Arial'; +var title = new Title({ + 'text': 'Title Text', + 'subtitle': 'Subtitle in serif font', + 'subtitleFont': 'serif', + 'fontSize': 16, + 'subtitleFontSize': 12 +}); -// Get: var v = title.subtitleFont; -// returns 'Arial' +// returns 'serif' + +title.subtitleFont = 'monospace'; + +v = title.subtitleFont; +// returns 'monospace' ``` +<!-- <figure class="figure" align="center" label="fig:title_subtitle_font_serif" src="./docs/img/figure_title_subtitle_font_serif.svg" alt="Title with subtitleFont set to serif."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle_font_serif"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_font_serif.svg" alt="Title with subtitleFont set to serif."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_subtitle_font_monospace" src="./docs/img/figure_title_subtitle_font_monospace.svg" alt="Title with subtitleFont set to monospace."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle_font_monospace"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_font_monospace.svg" alt="Title with subtitleFont set to monospace."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-subtitle-font-size"></a> #### Title.prototype.subtitleFontSize @@ -468,16 +932,40 @@ var v = title.subtitleFont; Font size for the subtitle text. ```javascript -var title = new Title(); - -// Set: -title.subtitleFontSize = 14; +var title = new Title({ + 'text': 'Title Text', + 'subtitle': 'subtitleFontSize: 10', + 'subtitleFontSize': 10, + 'fontSize': 16 +}); -// Get: var v = title.subtitleFontSize; -// returns 14 +// returns 10 + +title.subtitleFontSize = 18; + +v = title.subtitleFontSize; +// returns 18 ``` +<!-- <figure class="figure" align="center" label="fig:title_subtitle_fontsize_10" src="./docs/img/figure_title_subtitle_fontsize_10.svg" alt="Title with subtitleFontSize set to 10."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle_fontsize_10"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontsize_10.svg" alt="Title with subtitleFontSize set to 10."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_subtitle_fontsize_18" src="./docs/img/figure_title_subtitle_fontsize_18.svg" alt="Title with subtitleFontSize set to 18."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle_fontsize_18"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontsize_18.svg" alt="Title with subtitleFontSize set to 18."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-subtitle-font-style"></a> #### Title.prototype.subtitleFontStyle @@ -485,16 +973,41 @@ var v = title.subtitleFontSize; Font style for the subtitle text. ```javascript -var title = new Title(); +var title = new Title({ + 'text': 'Title Text', + 'subtitle': 'Normal style subtitle', + 'subtitleFontStyle': 'normal', + 'fontSize': 16, + 'subtitleFontSize': 12 +}); + +var v = title.subtitleFontStyle; +// returns 'normal' -// Set: title.subtitleFontStyle = 'italic'; -// Get: -var v = title.subtitleFontStyle; +v = title.subtitleFontStyle; // returns 'italic' ``` +<!-- <figure class="figure" align="center" label="fig:title_subtitle_fontstyle_normal" src="./docs/img/figure_title_subtitle_fontstyle_normal.svg" alt="Title with subtitleFontStyle set to normal."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle_fontstyle_normal"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontstyle_normal.svg" alt="Title with subtitleFontStyle set to normal."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_subtitle_fontstyle_italic" src="./docs/img/figure_title_subtitle_fontstyle_italic.svg" alt="Title with subtitleFontStyle set to italic."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle_fontstyle_italic"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontstyle_italic.svg" alt="Title with subtitleFontStyle set to italic."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-subtitle-font-weight"></a> #### Title.prototype.subtitleFontWeight @@ -502,16 +1015,41 @@ var v = title.subtitleFontStyle; Font weight for the subtitle text. ```javascript -var title = new Title(); +var title = new Title({ + 'text': 'Title Text', + 'subtitle': 'Normal weight subtitle', + 'subtitleFontWeight': 'normal', + 'fontSize': 16, + 'subtitleFontSize': 12 +}); + +var v = title.subtitleFontWeight; +// returns 'normal' -// Set: title.subtitleFontWeight = 'bold'; -// Get: -var v = title.subtitleFontWeight; +v = title.subtitleFontWeight; // returns 'bold' ``` +<!-- <figure class="figure" align="center" label="fig:title_subtitle_fontweight_normal" src="./docs/img/figure_title_subtitle_fontweight_normal.svg" alt="Title with subtitleFontWeight set to normal."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle_fontweight_normal"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontweight_normal.svg" alt="Title with subtitleFontWeight set to normal."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_subtitle_fontweight_bold" src="./docs/img/figure_title_subtitle_fontweight_bold.svg" alt="Title with subtitleFontWeight set to bold."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle_fontweight_bold"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_fontweight_bold.svg" alt="Title with subtitleFontWeight set to bold."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-subtitle-line-height"></a> #### Title.prototype.subtitleLineHeight @@ -519,16 +1057,41 @@ var v = title.subtitleFontWeight; Line height for multi-line subtitle text. ```javascript -var title = new Title(); - -// Set: -title.subtitleLineHeight = 16; +var title = new Title({ + 'text': 'Title Text', + 'subtitle': [ 'First subtitle line', 'Second subtitle line' ], + 'subtitleLineHeight': 10, + 'fontSize': 16, + 'subtitleFontSize': 12 +}); -// Get: var v = title.subtitleLineHeight; -// returns 16 +// returns 10 + +title.subtitleLineHeight = 30; + +v = title.subtitleLineHeight; +// returns 30 ``` +<!-- <figure class="figure" align="center" label="fig:title_subtitle_lineheight_10" src="./docs/img/figure_title_subtitle_lineheight_10.svg" alt="Title with subtitleLineHeight set to 10."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle_lineheight_10"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_lineheight_10.svg" alt="Title with subtitleLineHeight set to 10."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_subtitle_lineheight_30" src="./docs/img/figure_title_subtitle_lineheight_30.svg" alt="Title with subtitleLineHeight set to 30."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle_lineheight_30"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_lineheight_30.svg" alt="Title with subtitleLineHeight set to 30."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-subtitle-padding"></a> #### Title.prototype.subtitlePadding @@ -536,16 +1099,41 @@ var v = title.subtitleLineHeight; Padding (in pixels) between title and subtitle text. ```javascript -var title = new Title(); - -// Set: -title.subtitlePadding = 24; +var title = new Title({ + 'text': 'Title Text', + 'subtitle': 'subtitlePadding: 0', + 'subtitlePadding': 0, + 'fontSize': 16, + 'subtitleFontSize': 12 +}); -// Get: var v = title.subtitlePadding; -// returns 24 +// returns 0 + +title.subtitlePadding = 20; + +v = title.subtitlePadding; +// returns 20 ``` +<!-- <figure class="figure" align="center" label="fig:title_subtitle_padding_0" src="./docs/img/figure_title_subtitle_padding_0.svg" alt="Title with subtitlePadding set to 0."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle_padding_0"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_padding_0.svg" alt="Title with subtitlePadding set to 0."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_subtitle_padding_20" src="./docs/img/figure_title_subtitle_padding_20.svg" alt="Title with subtitlePadding set to 20."> --> + +<div class="figure" align="center" data-figure="fig:title_subtitle_padding_20"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_subtitle_padding_20.svg" alt="Title with subtitlePadding set to 20."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-text"></a> #### Title.prototype.text @@ -553,16 +1141,28 @@ var v = title.subtitlePadding; Title text. Default: `[]`. ```javascript -var title = new Title(); - -// Set: -title.text = 'Beep boop'; +var title = new Title({ + 'fontSize': 16 +}); -// Get: var v = title.text; -// returns [ 'Beep boop' ] +// returns [] + +title.text = 'Title Text'; + +v = title.text; +// returns [ 'Title Text' ] ``` +<!-- <figure class="figure" align="center" label="fig:title_text" src="./docs/img/figure_title_text.svg" alt="Title with text set."> --> + +<div class="figure" align="center" data-figure="fig:title_text"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_text.svg" alt="Title with text set."> + <br> +</div> + +<!-- </figure> --> + <a name="prop-zindex"></a> #### Title.prototype.zindex @@ -570,16 +1170,40 @@ var v = title.text; Integer z-index indicating the layering of the title group relative to other axis, mark, and legend groups. Default: `0`. ```javascript -var title = new Title(); +var title = new Title({ + 'text': 'Title Text (zindex: 0)', + 'zindex': 0, + 'fontSize': 16, + 'dy': 15 +}); + +var v = title.zindex; +// returns 0 -// Set: title.zindex = 2; -// Get: -var v = title.zindex; +v = title.zindex; // returns 2 ``` +<!-- <figure class="figure" align="center" label="fig:title_zindex_0" src="./docs/img/figure_title_zindex_0.svg" alt="Title with zindex set to 0 (title behind marks)."> --> + +<div class="figure" align="center" data-figure="fig:title_zindex_0"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_zindex_0.svg" alt="Title with zindex set to 0 (title behind marks)."> + <br> +</div> + +<!-- </figure> --> + +<!-- <figure class="figure" align="center" label="fig:title_zindex_2" src="./docs/img/figure_title_zindex_2.svg" alt="Title with zindex set to 2 (title in front of marks)."> --> + +<div class="figure" align="center" data-figure="fig:title_zindex_2"> + <img src="https://cdn.jsdelivr.net/gh/gururaj1512/stdlib@a7f3856b6b3b231de3f4c93c2b76f87be5bab78c/lib/node_modules/@stdlib/plot/vega/title/ctor/docs/img/figure_title_zindex_2.svg" alt="Title with zindex set to 2 (title in front of marks)."> + <br> +</div> + +<!-- </figure> --> + * * * ### Read-only Properties @@ -605,7 +1229,7 @@ var v = title.properties; #### Title.prototype.toJSON() -Serializes a title instance to a JSON object. +Serializes a title instance to a JSON representation. ```javascript var title = new Title({ @@ -623,7 +1247,7 @@ var title = new Title({ 'text': 'Beep boop' }); -var str = JSON.stringify( title ); +var v = JSON.stringify( title ); // returns '{"aria":true,"anchor":"middle","frame":"bounds","orient":"top","text":["Beep boop"],"zindex":0}' ``` diff --git a/lib/node_modules/@stdlib/plot/vega/title/ctor/srv/scripts/fig_title.js b/lib/node_modules/@stdlib/plot/vega/title/ctor/srv/scripts/fig_title.js new file mode 100644 index 0000000000000..723bb27f6f4e7 --- /dev/null +++ b/lib/node_modules/@stdlib/plot/vega/title/ctor/srv/scripts/fig_title.js @@ -0,0 +1,885 @@ +#!/usr/bin/env node + +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/* eslint-disable max-lines, stdlib/no-unnecessary-nested-functions, n/no-sync */ + +// MODULES // + +var resolve = require( 'path' ).resolve; +var join = require( 'path' ).join; +var logger = require( 'debug' ); +var extname = require( '@stdlib/utils/extname' ); +var readdirSync = require( '@stdlib/fs/read-dir' ).sync; +var unlinkSync = require( '@stdlib/fs/unlink' ).sync; +var existsSync = require( '@stdlib/fs/exists' ).sync; +var renderFig = require( '@stdlib/plot/vega/base/spec2svg-file' ); + + +// VARIABLES // + +var debug = logger( 'vega:title:figures' ); + +var IMG_DIR = resolve( __dirname, '..', '..', 'docs', 'img' ); +var SCHEMA = 'https://vega.github.io/schema/vega/v6.json'; +var BASE_WIDTH = 600; +var BASE_HEIGHT = 40; +var BASE_PADDING = 20; + +// Marks definition for drawing a background rectangle box for the chart group area: +var GROUP_RECT_MARKS = [ + { + 'type': 'rect', + 'encode': { + 'enter': { + 'x': { + 'value': 0 + }, + 'y': { + 'value': 0 + }, + 'width': { + 'signal': 'width' + }, + 'height': { + 'signal': 'height' + }, + 'fill': { + 'value': '#f5f5f5' + }, + 'stroke': { + 'value': '#ccc' + }, + 'strokeWidth': { + 'value': 1 + } + } + } + } +]; + +// Figure configuration array: +var FIGURES = [ + { + 'name': 'figure_title', + 'title': { + 'text': 'Monthly Revenue', + 'subtitle': 'Fiscal Year 2025', + 'anchor': 'middle', + 'fontSize': 18, + 'subtitleFontSize': 13, + 'subtitleColor': '#888' + }, + 'width': 600, + 'height': 200, + 'padding': 25, + 'scales': [ + { + 'name': 'x', + 'type': 'linear', + 'domain': [ 0, 10 ], + 'range': 'width' + }, + { + 'name': 'y', + 'type': 'linear', + 'domain': [ 0, 100 ], + 'range': 'height' + } + ], + 'axes': [ + { + 'scale': 'x', + 'orient': 'bottom', + 'title': 'Month', + 'grid': true, + 'gridOpacity': 0.15 + }, + { + 'scale': 'y', + 'orient': 'left', + 'title': 'Revenue ($K)', + 'grid': true, + 'gridOpacity': 0.15 + } + ] + }, + + // align: + { + 'name': 'figure_title_align_left', + 'title': { + 'text': 'Title Text', + 'subtitle': 'left title alignment', + 'subtitleFontStyle': 'italic', + 'subtitleFontSize': 12, + 'subtitlePadding': 4, + 'align': 'left', + 'fontSize': 16, + 'dx': -70 + } + }, + { + 'name': 'figure_title_align_center', + 'title': { + 'text': 'Title Text', + 'subtitle': 'center title alignment', + 'subtitleFontStyle': 'italic', + 'subtitleFontSize': 12, + 'subtitlePadding': 4, + 'align': 'center', + 'fontSize': 16 + } + }, + + // anchor: + { + 'name': 'figure_title_anchor_start', + 'title': { + 'text': 'anchor: start', + 'anchor': 'start', + 'fontSize': 16 + } + }, + { + 'name': 'figure_title_anchor_middle', + 'title': { + 'text': 'anchor: middle', + 'anchor': 'middle', + 'fontSize': 16 + } + }, + { + 'name': 'figure_title_anchor_end', + 'title': { + 'text': 'anchor: end', + 'anchor': 'end', + 'fontSize': 16 + } + }, + + // angle: + { + 'name': 'figure_title_angle_0', + 'title': { + 'text': 'Title Text', + 'fontSize': 16, + 'angle': 0 + } + }, + { + 'name': 'figure_title_angle_180', + 'title': { + 'text': 'Title Text', + 'fontSize': 16, + 'angle': 180 + } + }, + + // baseline: + { + 'name': 'figure_title_baseline_top', + 'title': { + 'text': 'baseline: top', + 'baseline': 'top', + 'fontSize': 16 + } + }, + { + 'name': 'figure_title_baseline_bottom', + 'title': { + 'text': 'baseline: bottom', + 'baseline': 'bottom', + 'fontSize': 16 + } + }, + + // color: + { + 'name': 'figure_title_color_steelblue', + 'title': { + 'text': 'Title Text', + 'color': 'steelblue', + 'fontSize': 16 + } + }, + { + 'name': 'figure_title_color_red', + 'title': { + 'text': 'Title Text', + 'color': '#e74c3c', + 'fontSize': 16 + } + }, + + // dx: + { + 'name': 'figure_title_dx_0', + 'title': { + 'text': 'dx: 0', + 'dx': 0, + 'anchor': 'start', + 'fontSize': 16 + } + }, + { + 'name': 'figure_title_dx_100', + 'title': { + 'text': 'dx: 100', + 'dx': 100, + 'anchor': 'start', + 'fontSize': 16 + } + }, + + // dy: + { + 'name': 'figure_title_dy_0', + 'title': { + 'text': 'dy: 0', + 'dy': 0, + 'fontSize': 16 + } + }, + { + 'name': 'figure_title_dy_100', + 'title': { + 'text': 'dy: 100', + 'dy': 100, + 'fontSize': 16 + }, + 'height': 80 + }, + + // font: + { + 'name': 'figure_title_font_serif', + 'title': { + 'text': 'Serif Font Title', + 'font': 'serif', + 'fontSize': 16 + } + }, + { + 'name': 'figure_title_font_monospace', + 'title': { + 'text': 'Monospace Font Title', + 'font': 'monospace', + 'fontSize': 16 + } + }, + + // fontSize: + { + 'name': 'figure_title_fontsize_12', + 'title': { + 'text': 'fontSize: 12', + 'fontSize': 12 + } + }, + { + 'name': 'figure_title_fontsize_20', + 'title': { + 'text': 'fontSize: 20', + 'fontSize': 20 + } + }, + { + 'name': 'figure_title_fontsize_28', + 'title': { + 'text': 'fontSize: 28', + 'fontSize': 28 + } + }, + + // fontStyle: + { + 'name': 'figure_title_fontstyle_normal', + 'title': { + 'text': 'Normal Style Title', + 'fontStyle': 'normal', + 'fontSize': 16 + } + }, + { + 'name': 'figure_title_fontstyle_italic', + 'title': { + 'text': 'Italic Style Title', + 'fontStyle': 'italic', + 'fontSize': 16 + } + }, + + // fontWeight: + { + 'name': 'figure_title_fontweight_normal', + 'title': { + 'text': 'Normal Weight Title', + 'fontWeight': 'normal', + 'fontSize': 16 + } + }, + { + 'name': 'figure_title_fontweight_bold', + 'title': { + 'text': 'Bold Weight Title', + 'fontWeight': 'bold', + 'fontSize': 16 + } + }, + + // frame: + { + 'name': 'figure_title_frame_bounds', + 'title': { + 'text': 'frame: bounds', + 'frame': 'bounds', + 'anchor': 'start', + 'fontSize': 16 + }, + 'height': 100, + 'padding': 25, + 'scales': [ + { + 'name': 'y', + 'type': 'linear', + 'domain': [ 0, 100 ], + 'range': 'height' + } + ], + 'axes': [ + { + 'scale': 'y', + 'orient': 'left', + 'title': 'Y Axis', + 'tickCount': 3 + } + ] + }, + { + 'name': 'figure_title_frame_group', + 'title': { + 'text': 'frame: group', + 'frame': 'group', + 'anchor': 'start', + 'fontSize': 16 + }, + 'height': 100, + 'padding': 25, + 'scales': [ + { + 'name': 'y', + 'type': 'linear', + 'domain': [ 0, 100 ], + 'range': 'height' + } + ], + 'axes': [ + { + 'scale': 'y', + 'orient': 'left', + 'title': 'Y Axis', + 'tickCount': 3 + } + ] + }, + + // limit: + { + 'name': 'figure_title_limit_none', + 'title': { + 'text': 'A Very Long Title That Shows Without Limit', + 'fontSize': 16 + } + }, + { + 'name': 'figure_title_limit_200', + 'title': { + 'text': 'A Very Long Title That Shows Without Limit', + 'limit': 200, + 'fontSize': 16 + } + }, + + // lineHeight: + { + 'name': 'figure_title_lineheight_20', + 'title': { + 'text': [ 'First Line', 'Second Line' ], + 'lineHeight': 20, + 'fontSize': 16 + } + }, + { + 'name': 'figure_title_lineheight_40', + 'title': { + 'text': [ 'First Line', 'Second Line' ], + 'lineHeight': 40, + 'fontSize': 16 + } + }, + + // offset: + { + 'name': 'figure_title_offset_0', + 'title': { + 'text': 'offset: 0', + 'offset': 0, + 'fontSize': 16 + } + }, + { + 'name': 'figure_title_offset_30', + 'title': { + 'text': 'offset: 30', + 'offset': 30, + 'fontSize': 16 + } + }, + + // orient: + { + 'name': 'figure_title_orient_top', + 'title': { + 'text': 'orient: top', + 'orient': 'top', + 'fontSize': 16 + }, + 'height': 60, + 'padding': 25 + }, + { + 'name': 'figure_title_orient_bottom', + 'title': { + 'text': 'orient: bottom', + 'orient': 'bottom', + 'fontSize': 16 + }, + 'height': 60, + 'padding': 25 + }, + + // subtitle: + { + 'name': 'figure_title_subtitle', + 'title': { + 'text': 'Title Text', + 'subtitle': 'This is the subtitle text', + 'fontSize': 16, + 'subtitleFontSize': 12 + } + }, + + // subtitleColor: + { + 'name': 'figure_title_subtitle_color_blue', + 'title': { + 'text': 'Title Text', + 'subtitle': 'This is the subtitle text', + 'subtitleColor': '#3498db', + 'fontSize': 16, + 'subtitleFontSize': 12 + } + }, + + // subtitleFontSize: + { + 'name': 'figure_title_subtitle_fontsize_10', + 'title': { + 'text': 'Title Text', + 'subtitle': 'subtitleFontSize: 10', + 'subtitleFontSize': 10, + 'fontSize': 16 + } + }, + { + 'name': 'figure_title_subtitle_fontsize_18', + 'title': { + 'text': 'Title Text', + 'subtitle': 'subtitleFontSize: 18', + 'subtitleFontSize': 18, + 'fontSize': 16 + } + }, + + // subtitleFont: + { + 'name': 'figure_title_subtitle_font_serif', + 'title': { + 'text': 'Title Text', + 'subtitle': 'Subtitle in serif font', + 'subtitleFont': 'serif', + 'fontSize': 16, + 'subtitleFontSize': 12 + } + }, + { + 'name': 'figure_title_subtitle_font_monospace', + 'title': { + 'text': 'Title Text', + 'subtitle': 'Subtitle in monospace font', + 'subtitleFont': 'monospace', + 'fontSize': 16, + 'subtitleFontSize': 12 + } + }, + + // subtitleFontStyle: + { + 'name': 'figure_title_subtitle_fontstyle_normal', + 'title': { + 'text': 'Title Text', + 'subtitle': 'Normal style subtitle', + 'subtitleFontStyle': 'normal', + 'fontSize': 16, + 'subtitleFontSize': 12 + } + }, + { + 'name': 'figure_title_subtitle_fontstyle_italic', + 'title': { + 'text': 'Title Text', + 'subtitle': 'Italic style subtitle', + 'subtitleFontStyle': 'italic', + 'fontSize': 16, + 'subtitleFontSize': 12 + } + }, + + // subtitleFontWeight: + { + 'name': 'figure_title_subtitle_fontweight_normal', + 'title': { + 'text': 'Title Text', + 'subtitle': 'Normal weight subtitle', + 'subtitleFontWeight': 'normal', + 'fontSize': 16, + 'subtitleFontSize': 12 + } + }, + { + 'name': 'figure_title_subtitle_fontweight_bold', + 'title': { + 'text': 'Title Text', + 'subtitle': 'Bold weight subtitle', + 'subtitleFontWeight': 'bold', + 'fontSize': 16, + 'subtitleFontSize': 12 + } + }, + + // subtitleLineHeight: + { + 'name': 'figure_title_subtitle_lineheight_10', + 'title': { + 'text': 'Title Text', + 'subtitle': [ 'First subtitle line', 'Second subtitle line' ], + 'subtitleLineHeight': 10, + 'fontSize': 16, + 'subtitleFontSize': 12 + } + }, + { + 'name': 'figure_title_subtitle_lineheight_30', + 'title': { + 'text': 'Title Text', + 'subtitle': [ 'First subtitle line', 'Second subtitle line' ], + 'subtitleLineHeight': 30, + 'fontSize': 16, + 'subtitleFontSize': 12 + } + }, + + // subtitlePadding: + { + 'name': 'figure_title_subtitle_padding_0', + 'title': { + 'text': 'Title Text', + 'subtitle': 'subtitlePadding: 0', + 'subtitlePadding': 0, + 'fontSize': 16, + 'subtitleFontSize': 12 + } + }, + { + 'name': 'figure_title_subtitle_padding_20', + 'title': { + 'text': 'Title Text', + 'subtitle': 'subtitlePadding: 20', + 'subtitlePadding': 20, + 'fontSize': 16, + 'subtitleFontSize': 12 + } + }, + + // text: + { + 'name': 'figure_title_text', + 'title': { + 'text': 'Title Text', + 'fontSize': 16 + } + }, + + // zindex: + { + 'name': 'figure_title_zindex_0', + 'title': { + 'text': 'Title Text (zindex: 0)', + 'fontSize': 16, + 'zindex': 0, + 'dy': 15 + }, + 'marks': [ + { + 'type': 'rect', + 'zindex': 1, + 'encode': { + 'enter': { + 'x': { + 'value': 0 + }, + 'y': { + 'value': 0 + }, + 'width': { + 'signal': 'width' + }, + 'height': { + 'signal': 'height' + }, + 'fill': { + 'value': '#e74c3c' + }, + 'opacity': { + 'value': 0.7 + } + } + } + } + ] + }, + { + 'name': 'figure_title_zindex_2', + 'title': { + 'text': 'Title Text (zindex: 2)', + 'fontSize': 16, + 'zindex': 2, + 'dy': 15 + }, + 'marks': [ + { + 'type': 'rect', + 'zindex': 1, + 'encode': { + 'enter': { + 'x': { + 'value': 0 + }, + 'y': { + 'value': 0 + }, + 'width': { + 'signal': 'width' + }, + 'height': { + 'signal': 'height' + }, + 'fill': { + 'value': '#e74c3c' + }, + 'opacity': { + 'value': 0.7 + } + } + } + } + ] + } +]; + + +// FUNCTIONS // + +/** +* Creates a Vega specification from a figure configuration. +* +* @private +* @param {Object} config - figure configuration +* @param {Object} config.title - Vega title object +* @param {number} [config.width] - override width +* @param {number} [config.height] - override height +* @param {number} [config.padding] - override padding +* @param {string} [config.background] - background color +* @param {Array} [config.scales] - Vega scale definitions +* @param {Array} [config.axes] - Vega axis definitions +* @param {Array} [config.marks] - Vega mark definitions +* @returns {Object} Vega specification +*/ +function createSpec( config ) { + var spec; + + spec = { + '$schema': SCHEMA, + 'width': config.width || BASE_WIDTH, + 'height': config.height || BASE_HEIGHT, + 'padding': config.padding || BASE_PADDING, + 'title': config.title, + 'background': config.background || '#ffffff', + 'marks': config.marks || GROUP_RECT_MARKS, + 'scales': config.scales || [], + 'axes': config.axes || [] + }; + return spec; +} + +/** +* Generates all figure SVGs sequentially. +* +* @private +* @param {Array} figures - figure configuration array +* @param {Callback} clbk - callback to invoke upon completion +* @returns {void} +*/ +function generateAll( figures, clbk ) { + var idx = 0; + next(); + + /** + * Processes the next figure in the queue. + * + * @private + * @returns {void} + */ + function next() { + var outputPath; + var config; + var spec; + + if ( idx >= figures.length ) { + return clbk( null ); + } + config = figures[ idx ]; + spec = createSpec( config ); + outputPath = join( IMG_DIR, config.name + '.svg' ); + + debug( 'Rendering: %s', config.name ); + renderFig( outputPath, spec, onDone ); + } + + /** + * Callback invoked upon completing a figure render. + * + * @private + * @param {(Error|null)} error - error object + * @returns {void} + */ + function onDone( error ) { + if ( error ) { + return clbk( error ); + } + debug( ' -> %s', join( IMG_DIR, figures[ idx ].name + '.svg' ) ); + idx += 1; + next(); + } +} + +/** +* Removes stale SVG files from a directory listing. +* +* @private +* @param {Array} files - directory entries +* @throws {Error} if unable to remove a stale file +* @returns {void} +*/ +function removeStaleFiles( files ) { + var valid; + var file; + var err; + var f; + var i; + var j; + + for ( i = 0; i < files.length; i++ ) { + file = files[ i ]; + if ( extname( file ) !== '.svg' ) { + continue; + } + valid = false; + for ( j = 0; j < FIGURES.length; j++ ) { + f = FIGURES[ j ].name + '.svg'; + if ( file === f ) { + valid = true; + break; + } + } + if ( !valid ) { + debug( 'Removing stale SVG: %s', file ); + err = unlinkSync( join( IMG_DIR, file ) ); + if ( err instanceof Error ) { + throw err; + } + } + } +} + + +// MAIN // + +/** +* Generates all title documentation figures. +* +* @private +* @returns {void} +*/ +function main() { + var files; + + if ( existsSync( IMG_DIR ) ) { + files = readdirSync( IMG_DIR ); + if ( files instanceof Error ) { + console.error( 'Error reading directory: %s', files.message ); // eslint-disable-line no-console + process.exitCode = 1; + return; + } + removeStaleFiles( files ); + } + // Generate all figure SVGs: + generateAll( FIGURES, onComplete ); + + /** + * Callback invoked upon completing all figure generation. + * + * @private + * @param {(Error|null)} error - error object + * @returns {void} + */ + function onComplete( error ) { + if ( error ) { + console.error( 'Error generating figures: %s', error.message ); // eslint-disable-line no-console + process.exitCode = 1; + return; + } + console.log( 'Successfully generated %d title figures.', FIGURES.length ); // eslint-disable-line no-console + } +} + +main();