all files / diagram/load-utility/visio-import-export/ visio-constants.js

100% Statements 27/27
100% Branches 2/2
100% Functions 2/2
100% Lines 27/27
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
define(["require", "exports"], function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.UNIT_CONVERSION = {
        SCREEN_DPI: 96,
        PIXEL_CONVERSION_FACTOR: 100,
        RADIANS_TO_DEGREES: 180 / Math.PI,
        DEGREES_TO_RADIANS: Math.PI / 180
    };
    exports.DEFAULT_STYLES = {
        FONT_SIZE: 10,
        FONT_FAMILY: 'Calibri',
        TEXT_COLOR: 'Black',
        TEXT_FILL: 'transparent',
        OPACITY: 1,
        STROKE_COLOR: '#757575',
        STROKE_WIDTH: 1
    };
    exports.LAYOUT_METRICS = {
        PATH_PRECISION: 4,
        PADDING_FOR_GROUP: 12,
        PADDING_FOR_SHAPE: 0
    };
    exports.BPMN_PROPERTIES = {
        PROPERTY_SECTION: 'Property',
        USER_SECTION: 'User',
        RELATIONSHIPS_CELL: 'Relationships',
        VALUE_CELL: 'Value',
        ACTIONS_SECTION: 'Actions'
    };
    exports.VALID_TYPES = new Set([
        'lumMod',
        'lumOff',
        'satMod',
        'satOff',
        'hueMod',
        'hueOff',
        'tint',
        'shade',
        'alpha',
        'alphaMod',
        'alphaOff',
        'hueShift'
    ]);
    exports.BPMN_SHAPE_TYPES = {
        EVENT: 'Event',
        GATEWAY: 'Gateway',
        ACTIVITY: 'Activity',
        DATA_OBJECT: 'DataObject',
        DATA_SOURCE: 'DataSource',
        TEXT_ANNOTATION: 'TextAnnotation',
        MESSAGE: 'Message',
        GROUP: 'Group'
    };
    exports.EVENT_NAME_MAP = {
        'start(non-interrupting)': 'NonInterruptingStart',
        'intermediate(non-interrupting)': 'NonInterruptingIntermediate',
        'intermediate(throwing)': 'ThrowingIntermediate'
    };
    exports.TRIGGER_MAP = {
        'parallelmultiple': 'Parallel'
    };
    exports.GATEWAY_MAP = {
        'exclusive': 'None',
        'inclusive': 'Inclusive',
        'parallel': 'Parallel',
        'complex': 'Complex',
        'event': 'EventBased',
        'eventbased': 'Exclusive',
        'exclusiveevent(instantiate)': 'ExclusiveEventBased',
        'parallelevent(instantiate)': 'ParallelEventBased'
    };
    exports.LOOP_TYPE_MAP = {
        'none': 'None',
        'standard': 'Standard',
        'parallelmultiinstance': 'ParallelMultiInstance',
        'sequentialmultiinstance': 'SequenceMultiInstance'
    };
    exports.ORIENTATION_MAP = {
        '1': 'Right',
        '2': 'Top',
        '3': 'Left',
        '4': 'Bottom'
    };
    exports.SHAPE_CATEGORIES = {
        BASIC: new Set([
            'Rectangle',
            'Ellipse',
            'Triangle',
            'Pentagon',
            'Heptagon',
            'Octagon',
            'Trapezoid',
            'Decagon',
            'RightTriangle',
            'Parallelogram',
            'Hexagon',
            'Cylinder',
            'Diamond',
            'Polygon',
            'Star',
            'Plus'
        ]),
        FLOW: new Set([
            'Terminator',
            'Process',
            'Decision',
            'Document',
            'Data',
            'Or',
            'Collate',
            'Merge',
            'Extract',
            'Sort',
            'SummingJunction',
            'MultiDocument',
            'OffPageReference',
            'PreDefinedProcess',
            'DirectData',
            'SequentialData',
            'PaperTap',
            'Card',
            'ManualOperation',
            'StoredData',
            'Preparation',
            'Display',
            'Delay'
        ]),
        BPMN: new Set([
            'StartEvent',
            'EndEvent',
            'IntermediateEvent',
            'Gateway',
            'DataStore',
            'DataObject',
            'TextAnnotation',
            'Task',
            'CollapsedSubProcess',
            'ExpandedSubProcess',
            'Group',
            'Message'
        ])
    };
    exports.SHAPE_TRANSFORMATIONS = new Map([
        ['Subprocess', 'PreDefinedProcess'],
        ['MagneticTape', 'SequentialData'],
        ['Database', 'DirectData'],
        ['Microform', 'PaperTap'],
        ['custom3', 'Card'],
        ['custom2', 'ManualOperation'],
        ['Start/End', 'Terminator'],
        ['ExternalData', 'StoredData'],
        ['Custom4', 'Preparation']
    ]);
    exports.BASIC_TRANSFORMATIONS = new Map([
        ['Cross', 'Plus'],
        ['5PointStar', 'Star'],
        ['Circle', 'Ellipse'],
        ['Can', 'Cylinder']
    ]);
    exports.LINE_PATTERN_MAP = {
        '2': '4 2',
        '3': '1 2',
        '4': '4 2 1 2',
        '5': '4 2 1 2 1 2',
        '6': '4 2 4 2 1 2',
        '7': '8 2 2 2',
        '8': '8 2 2 2 2 2',
        '9': '2 2',
        '10': '1 1',
        '11': '2 2 1 2',
        '12': '2 2 1 2 1 2',
        '13': '2 2 2 2 1 2',
        '14': '4 2 2 2',
        '15': '4 2 2 2 2 2',
        '16': '8 4 8',
        '17': '1 4',
        '18': '8 4 1 4',
        '19': '8 2 1 2 1 2',
        '20': '8 2 8 2 1 2',
        '21': '16 2 4 2',
        '22': '16 2 4 2 4 2',
        '23': '4 2 4 2'
    };
    var VisioTextStyleFlag;
    (function (VisioTextStyleFlag) {
        VisioTextStyleFlag[VisioTextStyleFlag["BOLD"] = 1] = "BOLD";
        VisioTextStyleFlag[VisioTextStyleFlag["ITALIC"] = 2] = "ITALIC";
        VisioTextStyleFlag[VisioTextStyleFlag["UNDERLINE"] = 4] = "UNDERLINE";
    })(VisioTextStyleFlag = exports.VisioTextStyleFlag || (exports.VisioTextStyleFlag = {}));
    exports.VisioHorizontalAlignValue = {
        LEFT: '0',
        CENTER: '1',
        RIGHT: '2',
        JUSTIFY: '3'
    };
    exports.VisioVerticalAlignValue = {
        TOP: '0',
        CENTER: '1',
        BOTTOM: '2'
    };
    exports.DECORATOR_SHAPE_MAP = {
        0: 'None',
        2: 'Arrow',
        3: 'OpenArrow',
        4: 'Arrow',
        5: 'IndentedArrow',
        6: 'OutdentedArrow',
        7: 'OpenFetch',
        8: 'Fletch',
        11: 'Square',
        13: 'Arrow',
        22: 'Diamond',
        39: 'DoubleArrow',
        42: 'Circle'
    };
    exports.DECORATOR_SIZE_MAP = {
        arrow: [
            { width: 4, height: 4 },
            { width: 6, height: 6 },
            { width: 8, height: 8 },
            { width: 10, height: 10 },
            { width: 12.5, height: 12.5 },
            { width: 25, height: 25 },
            { width: 50, height: 50 }
        ],
        square: [
            { width: 4, height: 4 },
            { width: 5, height: 5 },
            { width: 6, height: 6 },
            { width: 8, height: 8 },
            { width: 10, height: 10 },
            { width: 20, height: 20 },
            { width: 40, height: 40 }
        ],
        diamond: [
            { width: 15, height: 8 },
            { width: 18, height: 9 },
            { width: 20, height: 11 },
            { width: 25, height: 13 },
            { width: 30, height: 15 },
            { width: 60, height: 30 },
            { width: 120, height: 60 }
        ]
    };
    exports.IMPORT_LIMITATIONS = [
        'DiagramProp1: Segment thumb customization is not supported in Visio.',
        'DiagramProp2: Context menu settings are not preserved.',
        'DiagramProp3: Constraints and interaction modes are ignored.',
        'DiagramProp4: Automatic port creation is not supported.',
        'DiagramProp5: Page-level editing features are not preserved.',
        'DiagramProp6: Tooltip settings are not imported or exported.',
        'DiagramProp7: Undo/Redo features are not preserved.',
        'DiagramProp8: Zoom and scroll settings are not fully preserved.',
        'DiagramProp9: Tool customization is not supported.',
        'DiagramProp10: Bridge direction is not preserved.',
        'DiagramProp11: Only solid background colors supported, not gradients.',
        'DiagramProp12: Grid and snap settings are not fully compatible.',
        'DiagramProp13: Ruler settings are approximated.',
        'DiagramProp14: Page settings like margin may require adjustment.',
        'DiagramProp15: Layering is limited (no multi-layer assignment).',
        'DiagramProp16: Templates are not imported or exported.',
        'DiagramProp17: Custom property access is not supported.',
        'DiagramProp18: Selection updates are not preserved.',
        'DiagramProp19: Zooming settings are application-level.',
        'DiagramProp20: Layout and model settings are not imported.',
        'DiagramProp21: Command manager is not supported.',
        'NodeProp1: Some shape appearances differ (Parallelogram, Trapezoid, etc.).',
        'NodeProp2: Shapes beyond 13 basic and 29 flow shapes render as paths.',
        'NodeProp3: Visio does not expose shape type directly.',
        'NodeProp4: Grouped shapes are not yet handled.',
        'NodeProp5: Gradient fills are approximated.',
        'NodeProp6: Only linear and radial gradients supported.',
        'NodeProp7: Pattern fills are not supported.',
        'NodeProp8: Line gradients are not supported.',
        'NodeProp9: Compound types are not supported.',
        'NodeProp10: Dashed patterns partially match.',
        'NodeProp11: Cap type adjustment only for rectangles.',
        'NodeProp12: No support for rounded ends simulation.',
        'NodeProp13: Shadow effects have limited support.',
        'NodeProp14: Only outer shadows supported (no offset center).',
        'NodeProp15: Only theme colors replicated, not patterns.',
        'NodeProp16: Several protection categories not supported.',
        'NodeProp17: Individual XY drag constraints not supported.',
        'NodeProp18: Shape stroke color applied internally to BPMN elements.',
        'NodeProp19: Text annotations must be on same layer as target.',
        'NodeProp20: BPMN shapes visually differ.',
        'ConnectorProp1: No explicit connector type identifier.',
        'ConnectorProp2: Only arc line jump style supported.',
        'ConnectorProp3: Only horizontal line jumps supported.',
        'ConnectorProp4: Drag constraints fully disabled if any axis locked.',
        'ConnectorProp5: Bezier curves approximated.',
        'ConnectorProp6: Connector gradient not supported.',
        'ConnectorProp7: Limited decorator shapes (12 of 45).',
        'ConnectorProp8: Decorator sizes approximated.',
        'ConnectorProp9: Gradient support differs.',
        'ConnectorProp10: Gradients approximated.',
        'ConnectorProp11: Connector routing constrained by geometry data.',
        'ConnectorProp12: Stroke dash arrays differ.',
        'ConnectorProp13: Compound type and cap type not supported.',
        'ConnectorProp14: Corner radius differs.'
    ];
});