mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-16 04:29:44 +02:00
rename reset
to resetConfig
This commit is contained in:
@@ -17,7 +17,7 @@ export interface InjectUtils {
|
|||||||
*/
|
*/
|
||||||
export interface DiagramDB {
|
export interface DiagramDB {
|
||||||
// config
|
// config
|
||||||
reset?: () => void;
|
resetConfig?: () => void;
|
||||||
setConfig?: (config: BaseDiagramConfig) => void;
|
setConfig?: (config: BaseDiagramConfig) => void;
|
||||||
getConfig?: () => BaseDiagramConfig | undefined;
|
getConfig?: () => BaseDiagramConfig | undefined;
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@ describe('pie chart', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
parser.yy = db;
|
parser.yy = db;
|
||||||
db.clear();
|
db.clear();
|
||||||
db.reset();
|
db.resetConfig();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('parse', () => {
|
describe('parse', () => {
|
||||||
@@ -171,7 +171,7 @@ describe('pie chart', () => {
|
|||||||
|
|
||||||
it('reset', () => {
|
it('reset', () => {
|
||||||
db.setConfig({ textPosition: 0 });
|
db.setConfig({ textPosition: 0 });
|
||||||
db.reset();
|
db.resetConfig();
|
||||||
expect(db.getConfig().textPosition).toStrictEqual(DEFAULT_PIE_DB.config.textPosition);
|
expect(db.getConfig().textPosition).toStrictEqual(DEFAULT_PIE_DB.config.textPosition);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -40,7 +40,7 @@ const setConfig = (conf: PieDiagramConfig): void => {
|
|||||||
|
|
||||||
const getConfig = (): Required<PieDiagramConfig> => config;
|
const getConfig = (): Required<PieDiagramConfig> => config;
|
||||||
|
|
||||||
const reset = (): void => {
|
const resetConfig = (): void => {
|
||||||
config.useWidth = DEFAULT_PIE_CONFIG.useWidth;
|
config.useWidth = DEFAULT_PIE_CONFIG.useWidth;
|
||||||
config.useMaxWidth = DEFAULT_PIE_CONFIG.useMaxWidth;
|
config.useMaxWidth = DEFAULT_PIE_CONFIG.useMaxWidth;
|
||||||
config.textPosition = DEFAULT_PIE_CONFIG.textPosition;
|
config.textPosition = DEFAULT_PIE_CONFIG.textPosition;
|
||||||
@@ -82,7 +82,7 @@ const getShowData = (): boolean => showData;
|
|||||||
export const db: PieDB = {
|
export const db: PieDB = {
|
||||||
setConfig,
|
setConfig,
|
||||||
getConfig,
|
getConfig,
|
||||||
reset,
|
resetConfig,
|
||||||
|
|
||||||
parseDirective,
|
parseDirective,
|
||||||
clear,
|
clear,
|
||||||
|
@@ -43,7 +43,7 @@ export interface D3Sections {
|
|||||||
|
|
||||||
export interface PieDB extends DiagramDB {
|
export interface PieDB extends DiagramDB {
|
||||||
// config
|
// config
|
||||||
reset: () => void;
|
resetConfig: () => void;
|
||||||
setConfig: (config: PieDiagramConfig) => void;
|
setConfig: (config: PieDiagramConfig) => void;
|
||||||
getConfig: () => Required<PieDiagramConfig>;
|
getConfig: () => Required<PieDiagramConfig>;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user