-
Notifications
You must be signed in to change notification settings - Fork 0
/
gCS_js_dataurl.tcl
4 lines (4 loc) · 5.92 KB
/
gCS_js_dataurl.tcl
1
2
3
4
#=== gCS.js (Yuji SODE,2017): the MIT License; https://gist.github.com/YujiSODE/a8d3ba4f02567533124a6fd05563f125 ===
#These functions ("gCS_color" and "gCS_pattern") generate a stratum for geological columnar section on a given canvas tag. "gCS_scale" generates scale bar.
#base64 encoded dataurl version on Mon_Nov_06_14:28:14_GMT_2017
set dataurls(gCS.js) {data:text/javascript;base64,LypnQ1MuanMKKgoqICAgIENvcHlyaWdodCAoYykgMjAxNyBZdWppIFNPREUgPHl1amkuc29kZUBnbWFpbC5jb20+CioKKiAgICBUaGlzIHNvZnR3YXJlIGlzIHJlbGVhc2VkIHVuZGVyIHRoZSBNSVQgTGljZW5zZS4KKi8KLy9UaGVzZSBmdW5jdGlvbnMgKCJnQ1NfY29sb3IiIGFuZCAiZ0NTX3BhdHRlcm4iKSBnZW5lcmF0ZSBhIHN0cmF0dW0gZm9yIGdlb2xvZ2ljYWwgY29sdW1uYXIgc2VjdGlvbiBvbiBhIGdpdmVuIGNhbnZhcyB0YWcuCi8vImdDU19zY2FsZSIgZ2VuZXJhdGVzIHNjYWxlIGJhci4KdmFyIGdDU19jb2xvcj1mdW5jdGlvbihjdnMseDAseTAsZHgxLGR4MixkeSxjb2xvcix0ZXh0KXsKICAgIC8qY3ZzIGlzIGEgY2FudmFzIGVsZW1lbnQKICAgICogeDAsIHkwLCBkeDEsIGR4MiBhbmQgZHkgYXJlIGxlbmd0aHMgaW4gcGl4ZWxzCiAgICAqIGR4MSBhbmQgZHgyIGFyZSBsb3dlciBhbmQgdXBwZXIgd2lkdGhzCiAgICAqIGNvbG9yIGlzIENTUyA8Y29sb3I+IHZhbHVlCiAgICAqIHRleHQgaXMgc2hvcnQgdGV4dAogICAgKi8KICAgIC8qCiAgICAqIHgwLCB5MCwgZHgxLCBkeDIgYW5kIGR5IGFyZSBzaG93biBhcyBm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