Skip to content

Commit 885ff1a

Browse files
committed
feat: add route for axis title opacity
1 parent 9de4cd7 commit 885ff1a

5 files changed

Lines changed: 145 additions & 4 deletions

File tree

lib/node_modules/@stdlib/plot/base/view/lib/browser/routes/app/bundle.js

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2026 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var schema = require( './schema.json' );
24+
var handler = require( './main.js' );
25+
26+
27+
// MAIN //
28+
29+
/**
30+
* Defines a route handler for receiving updating a plot configuration.
31+
*
32+
* @private
33+
* @returns {Object} route declaration
34+
*/
35+
function route() {
36+
schema.handler = handler;
37+
return schema;
38+
}
39+
40+
41+
// EXPORTS //
42+
43+
module.exports = route;
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2026 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var middleware = require( './../../../../middleware_sequence.js' );
24+
var allowCredentials = require( './../../../../middleware/allow-credentials' );
25+
var tryAssign = require( './../../../../middleware/plot-try-assign' );
26+
var body = require( './../../../../middleware/body' );
27+
var ok = require( './../../../../middleware/ok' );
28+
var onError = require( './../../../../middleware/error' );
29+
var transform = require( './../../transforms.js' ).toNumber;
30+
31+
32+
// VARIABLES //
33+
34+
var steps = [
35+
allowCredentials,
36+
body,
37+
tryAssign( [ 'config', 'axes', ':axis' ], 'titleOpacity', transform ),
38+
ok
39+
];
40+
41+
42+
// MAIN //
43+
44+
/**
45+
* Request handler for updating a plot configuration.
46+
*
47+
* @private
48+
* @name handler
49+
* @type {Function}
50+
* @param {Object} request - request object
51+
* @param {Object} response - response object
52+
*/
53+
var handler = middleware( steps, onError );
54+
55+
56+
// EXPORTS //
57+
58+
module.exports = handler;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"method": "POST",
3+
"url": "/config/axes/:axis/titleOpacity",
4+
"schema": {
5+
"response": {
6+
"200": {
7+
"type": "string"
8+
},
9+
"400": {
10+
"type": "object",
11+
"properties": {
12+
"statusCode": {
13+
"type": "integer"
14+
},
15+
"error": {
16+
"type": "string"
17+
},
18+
"message": {
19+
"type": "string"
20+
}
21+
}
22+
},
23+
"413": {
24+
"type": "object",
25+
"properties": {
26+
"statusCode": {
27+
"type": "integer"
28+
},
29+
"error": {
30+
"type": "string"
31+
},
32+
"message": {
33+
"type": "string"
34+
}
35+
}
36+
}
37+
}
38+
},
39+
"handler": null
40+
}

lib/node_modules/@stdlib/plot/base/view/lib/browser/routes/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ var home = require( './home' );
2727
var landing = require( './landing' );
2828
var ping = require( './ping' );
2929
var schema = require( './schema' );
30-
var status = require( './status' ); // eslint-disable-line stdlib/no-redeclare
31-
30+
var status = require( './status' );
3231
var lilgui = require( './vendored/lilgui' );
3332
var vega = require( './vendored/vega' );
34-
3533
var axesAria = require( './config/axes/aria' );
3634
var axesBandPosition = require( './config/axes/band-position' );
3735
var axesDescription = require( './config/axes/description' );
@@ -49,6 +47,7 @@ var axesOrient = require( './config/axes/orient' );
4947
var axesTickColor = require( './config/axes/tick-color' );
5048
var axesTitle = require( './config/axes/title' );
5149
var axesTitleColor = require( './config/axes/title-color' );
50+
var axesTitleOpacity = require( './config/axes/title-opacity' );
5251
var background = require( './config/background' );
5352
var description = require( './config/description' );
5453
var height = require( './config/height' );
@@ -130,6 +129,7 @@ function register( router ) {
130129
router.route( axesTickColor() ); // /config/axes/:axis/tickColor
131130
router.route( axesTitle() ); // /config/axes/:axis/title
132131
router.route( axesTitleColor() ); // /config/axes/:axis/titleColor
132+
router.route( axesTitleOpacity() ); // /config/axes/:axis/titleOpacity
133133

134134
router.route( background() ); // /config/background
135135

0 commit comments

Comments
 (0)