Skip to content

Commit 9f0fade

Browse files
committed
feat: add support for axis title opacity menu
--- 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: passed - 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 ---
1 parent 885ff1a commit 9f0fade

3 files changed

Lines changed: 12 additions & 13 deletions

File tree

  • lib/node_modules/@stdlib/plot/base/view/lib/browser/app

lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/config/axis.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ var resolveTextValue = require( './resolve_text_value.js' );
2727

2828
// VARIABLES //
2929

30-
var PROPS = [];
30+
var PROPS = [
31+
'titleOpacity'
32+
];
3133
var TEXT_PROPS = [
3234
'title'
3335
];

lib/node_modules/@stdlib/plot/base/view/lib/browser/app/editor/menus/axis.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,13 @@ function addMenu( parent, conf, name ) {
6060

6161
def = defaults.axis;
6262

63-
// FIXME: remove this once we have proper defaults
64-
def = {
65-
'title': {
66-
'property': 'title',
67-
'default': '',
68-
'type': 'string'
69-
}
70-
};
7163
controllers = {};
7264
for ( i = 0; i < keys.length; i++ ) {
7365
k = keys[ i ];
7466
d = def[ k ];
75-
if ( k === 'titleColor' ) {
67+
if ( k === 'title' ) {
68+
controller = folder.add( conf, k );
69+
} else if ( k === 'titleColor' ) {
7670
controller = folder.addColor( conf, k );
7771
} else if ( k === 'titleFont' ) {
7872
controller = folder.add( conf, k );
@@ -88,8 +82,10 @@ function addMenu( parent, conf, name ) {
8882
} else if ( k === 'titleLineHeight' ) {
8983
controller = folder.add( conf, k )
9084
.min( d.min );
91-
} else if ( k === 'title' ) {
92-
controller = folder.add( conf, k );
85+
} else if ( k === 'titleOpacity' ) {
86+
controller = folder.add( conf, k )
87+
.min( d.min )
88+
.max( d.max );
9389
} else {
9490
console.log( 'Unrecognized property in editor configuration. Key: %s.', k );
9591
continue;

lib/node_modules/@stdlib/plot/base/view/lib/browser/app/schema/transforms/axis.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ var signalName = require( './../../utils/signal_name.js' );
2929
// VARIABLES //
3030

3131
var PROPS = [
32-
'title'
32+
'title',
33+
'titleOpacity'
3334
];
3435

3536

0 commit comments

Comments
 (0)