* Standard configuration defaults for Vega specification parsing. * Users can provide their own (sub-)set of these default values * by passing in a config object to the top-level parse method.
()
| 149757 | * Users can provide their own (sub-)set of these default values |
| 149758 | * by passing in a config object to the top-level parse method. |
| 149759 | */ function defaults() { |
| 149760 | const defaultFont = "sans-serif", defaultSymbolSize = 30, defaultStrokeWidth = 2, defaultColor = "#4c78a8", black = "#000", gray = "#888", lightGray = "#ddd"; |
| 149761 | return { |
| 149762 | // default visualization description |
| 149763 | description: "Vega visualization", |
| 149764 | // default padding around visualization |
| 149765 | padding: 0, |
| 149766 | // default for automatic sizing; options: 'none', 'pad', 'fit' |
| 149767 | // or provide an object (e.g., {'type': 'pad', 'resize': true}) |
| 149768 | autosize: "pad", |
| 149769 | // default view background color |
| 149770 | // covers the entire view component |
| 149771 | background: null, |
| 149772 | // default event handling configuration |
| 149773 | // preventDefault for view-sourced event types except 'wheel' |
| 149774 | events: { |
| 149775 | defaults: { |
| 149776 | allow: [ |
| 149777 | "wheel" |
| 149778 | ] |
| 149779 | } |
| 149780 | }, |
| 149781 | // defaults for top-level group marks |
| 149782 | // accepts mark properties (fill, stroke, etc) |
| 149783 | // covers the data rectangle within group width/height |
| 149784 | group: null, |
| 149785 | // defaults for basic mark types |
| 149786 | // each subset accepts mark properties (fill, stroke, etc) |
| 149787 | mark: null, |
| 149788 | arc: { |
| 149789 | fill: defaultColor |
| 149790 | }, |
| 149791 | area: { |
| 149792 | fill: defaultColor |
| 149793 | }, |
| 149794 | image: null, |
| 149795 | line: { |
| 149796 | stroke: defaultColor, |
| 149797 | strokeWidth: defaultStrokeWidth |
| 149798 | }, |
| 149799 | path: { |
| 149800 | stroke: defaultColor |
| 149801 | }, |
| 149802 | rect: { |
| 149803 | fill: defaultColor |
| 149804 | }, |
| 149805 | rule: { |
| 149806 | stroke: black |
| 149807 | }, |
| 149808 | shape: { |
| 149809 | stroke: defaultColor |
| 149810 | }, |
| 149811 | symbol: { |
| 149812 | fill: defaultColor, |
| 149813 | size: 64 |
| 149814 | }, |
| 149815 | text: { |
| 149816 | fill: black, |