Skip to content
45 changes: 45 additions & 0 deletions lib/node_modules/@stdlib/plot/vega/mark/arc/ctor/examples/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* @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';

var Value = require( '@stdlib/plot/vega/value/ctor' );
var ArcEncodingSet = require( '@stdlib/plot/vega/mark/arc/encoding-set' );
var ArcEncoding = require( '@stdlib/plot/vega/mark/arc/encoding' );
var ArcMark = require( './../lib' );

var mark = new ArcMark({
'encode': new ArcEncoding({
'enter': new ArcEncodingSet({
'stroke': new Value({
'value': '#000'
})
}),
'update': new ArcEncodingSet({
'stroke': new Value({
'value': 'steelblue'
})
}),
'exit': new ArcEncodingSet({
'stroke': new Value({
'value': '#fff'
})
})
})
});
console.log( mark.toJSON() );
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* @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';

// MAIN //

/**
* Returns a new change event object.
*
* @private
* @param {string} property - property name
* @returns {Object} event object
*/
function event( property ) { // eslint-disable-line stdlib/no-redeclare
return {
'type': 'update',
'source': 'mark',
'property': property
};
}


// EXPORTS //

module.exports = event;
51 changes: 51 additions & 0 deletions lib/node_modules/@stdlib/plot/vega/mark/arc/ctor/lib/defaults.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* @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';

// MODULES //

var ArcEncoding = require( '@stdlib/plot/vega/mark/arc/encoding' );


// MAIN //

/**
* Returns defaults.
*
* @private
* @returns {Object} default options
*
* @example
* var o = defaults();
* // returns {...}
*/
function defaults() {
return {
// Visual encoding rules for arc mark properties:
'encoding': new ArcEncoding(),

// Mark type:
'type': 'arc'
};
}


// EXPORTS //

module.exports = defaults;
43 changes: 43 additions & 0 deletions lib/node_modules/@stdlib/plot/vega/mark/arc/ctor/lib/encode/get.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* @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.
*/

/* eslint-disable no-invalid-this */

'use strict';

// MODULES //

var prop = require( './properties.js' );


// MAIN //

/**
* Returns the set of visual encoding rules for arc mark properties.
*
* @private
* @returns {(ArcEncoding|void)} encodings
*/
function get() {
return this[ prop.private ];
}


// EXPORTS //

module.exports = get;
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* @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';

// MODULES //

var property2object = require( '@stdlib/plot/vega/base/property2object' );


// MAIN //

var obj = property2object( 'encode' );


// EXPORTS //

module.exports = obj;
66 changes: 66 additions & 0 deletions lib/node_modules/@stdlib/plot/vega/mark/arc/ctor/lib/encode/set.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
* @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.
*/

/* eslint-disable no-invalid-this */

'use strict';

// MODULES //

var logger = require( 'debug' );
var isArcMarkEncoding = require( '@stdlib/plot/vega/base/assert/is-arc-mark-encoding' );
var isUndefined = require( '@stdlib/assert/is-undefined' );
var format = require( '@stdlib/string/format' );
var changeEvent = require( './../change_event.js' );
var prop = require( './properties.js' );


// VARIABLES //

var debug = logger( 'vega:mark:arc:set:'+prop.name );


// MAIN //

/**
* Sets the visual encoding rules for arc mark properties.
*
* ## Notes
*
* - Providing `undefined` "unsets" the configured value.

Check warning on line 45 in lib/node_modules/@stdlib/plot/vega/mark/arc/ctor/lib/encode/set.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Unknown word: "unsets"
*
* @private
* @param {(Encoding|void)} value - input value
* @throws {TypeError} must be an arc mark encoding instance
* @returns {void}
*/
function set( value ) {
if ( !isArcMarkEncoding( value ) && !isUndefined( value ) ) {
throw new TypeError( format( 'invalid assignment. `%s` must be an arc mark encoding instance. Value: `%s`.', prop.name, value ) );
}
if ( value !== this[ prop.private ] ) {
debug( 'Current value: %s. New value: %s.', JSON.stringify( this[ prop.private ] ), JSON.stringify( value ) );
this[ prop.private ] = value;
this.emit( 'change', changeEvent( prop.name ) );
}
}


// EXPORTS //

module.exports = set;
40 changes: 40 additions & 0 deletions lib/node_modules/@stdlib/plot/vega/mark/arc/ctor/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* @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';

/**
* Arc mark constructor.
*
* @module @stdlib/plot/vega/mark/arc/ctor
*
* @example
* var ArcMark = require( '@stdlib/plot/vega/mark/arc/ctor' );
*
* var mark = new ArcMark();
* // returns <ArcMark>
*/

// MODULES //

var main = require( './main.js' );


// EXPORTS //

module.exports = main;
Loading
Loading