@antv/gpt-vis 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -104,7 +104,7 @@ function createVisWrapper(container, config = {}) {
|
|
|
104
104
|
<div class="gpt-vis-wrapper-chart">
|
|
105
105
|
<div class="gpt-vis-wrapper-chart-container"></div>
|
|
106
106
|
</div>
|
|
107
|
-
<div class="gpt-vis-wrapper-code gpt-vis-wrapper-tab-hide"
|
|
107
|
+
<div class="gpt-vis-wrapper-code gpt-vis-wrapper-tab-hide"></div>
|
|
108
108
|
</div>
|
|
109
109
|
</div>
|
|
110
110
|
`;
|
|
@@ -114,6 +114,7 @@ function createVisWrapper(container, config = {}) {
|
|
|
114
114
|
const codeTabButton = wrapperContainer.querySelector('[data-tab="code"]');
|
|
115
115
|
const chartWrapper = wrapperContainer.querySelector(".gpt-vis-wrapper-chart");
|
|
116
116
|
const codeContainer = wrapperContainer.querySelector(".gpt-vis-wrapper-code");
|
|
117
|
+
codeContainer.textContent = syntaxString;
|
|
117
118
|
const chartContainer = wrapperContainer.querySelector(
|
|
118
119
|
".gpt-vis-wrapper-chart-container"
|
|
119
120
|
);
|
|
@@ -65,7 +65,7 @@ export function createVisWrapper(container) {
|
|
|
65
65
|
var zoomButtonsHTML = "\n <button class=\"gpt-vis-wrapper-text-button gpt-vis-wrapper-zoom-button gpt-vis-wrapper-tab-hide\"\n data-action=\"zoom-out\"\n aria-label=\"Zoom out\"\n title=\"Zoom out\">\n ".concat(createZoomOutIcon(18), "\n </button>\n <button class=\"gpt-vis-wrapper-text-button gpt-vis-wrapper-zoom-button gpt-vis-wrapper-tab-hide\"\n data-action=\"zoom-in\"\n aria-label=\"Zoom in\"\n title=\"Zoom in\">\n ").concat(createZoomInIcon(18), "\n </button>\n <div class=\"gpt-vis-wrapper-divider gpt-vis-wrapper-tab-hide\"></div>\n ");
|
|
66
66
|
|
|
67
67
|
// Create wrapper HTML structure using template string
|
|
68
|
-
var wrapperHTML = "\n <div class=\"gpt-vis-wrapper-container\">\n <div class=\"gpt-vis-wrapper-header\">\n <div class=\"gpt-vis-wrapper-tab-left\">\n <button class=\"gpt-vis-wrapper-tab-button active\" \n data-tab=\"chart\"\n role=\"tab\" \n aria-selected=\"true\" \n aria-controls=\"chart-panel\">\n ".concat(labels.chartTab, "\n </button>\n <button class=\"gpt-vis-wrapper-tab-button\" \n data-tab=\"code\"\n role=\"tab\" \n aria-selected=\"false\" \n aria-controls=\"code-panel\">\n ").concat(labels.codeTab, "\n </button>\n </div>\n <div class=\"gpt-vis-wrapper-tab-right\">\n ").concat(zoomButtonsHTML, "\n <button class=\"gpt-vis-wrapper-text-button\" \n data-action=\"download\"\n aria-label=\"").concat(labels.download, "\">\n ").concat(createDownloadIcon(16), " <span>").concat(labels.download, "</span>\n </button>\n <button class=\"gpt-vis-wrapper-text-button gpt-vis-wrapper-tab-hide\" \n data-action=\"copy\"\n aria-label=\"").concat(labels.copy, "\">\n ").concat(createCopyIcon(), " <span>").concat(labels.copy, "</span>\n </button>\n </div>\n </div>\n <div class=\"gpt-vis-wrapper-content\">\n <div class=\"gpt-vis-wrapper-chart\">\n <div class=\"gpt-vis-wrapper-chart-container\"></div>\n </div>\n <div class=\"gpt-vis-wrapper-code gpt-vis-wrapper-tab-hide\"
|
|
68
|
+
var wrapperHTML = "\n <div class=\"gpt-vis-wrapper-container\">\n <div class=\"gpt-vis-wrapper-header\">\n <div class=\"gpt-vis-wrapper-tab-left\">\n <button class=\"gpt-vis-wrapper-tab-button active\" \n data-tab=\"chart\"\n role=\"tab\" \n aria-selected=\"true\" \n aria-controls=\"chart-panel\">\n ".concat(labels.chartTab, "\n </button>\n <button class=\"gpt-vis-wrapper-tab-button\" \n data-tab=\"code\"\n role=\"tab\" \n aria-selected=\"false\" \n aria-controls=\"code-panel\">\n ").concat(labels.codeTab, "\n </button>\n </div>\n <div class=\"gpt-vis-wrapper-tab-right\">\n ").concat(zoomButtonsHTML, "\n <button class=\"gpt-vis-wrapper-text-button\" \n data-action=\"download\"\n aria-label=\"").concat(labels.download, "\">\n ").concat(createDownloadIcon(16), " <span>").concat(labels.download, "</span>\n </button>\n <button class=\"gpt-vis-wrapper-text-button gpt-vis-wrapper-tab-hide\" \n data-action=\"copy\"\n aria-label=\"").concat(labels.copy, "\">\n ").concat(createCopyIcon(), " <span>").concat(labels.copy, "</span>\n </button>\n </div>\n </div>\n <div class=\"gpt-vis-wrapper-content\">\n <div class=\"gpt-vis-wrapper-chart\">\n <div class=\"gpt-vis-wrapper-chart-container\"></div>\n </div>\n <div class=\"gpt-vis-wrapper-code gpt-vis-wrapper-tab-hide\"></div>\n </div>\n </div>\n ");
|
|
69
69
|
|
|
70
70
|
// Insert HTML into container
|
|
71
71
|
containerElement.innerHTML = wrapperHTML;
|
|
@@ -76,6 +76,7 @@ export function createVisWrapper(container) {
|
|
|
76
76
|
var codeTabButton = wrapperContainer.querySelector('[data-tab="code"]');
|
|
77
77
|
var chartWrapper = wrapperContainer.querySelector('.gpt-vis-wrapper-chart');
|
|
78
78
|
var codeContainer = wrapperContainer.querySelector('.gpt-vis-wrapper-code');
|
|
79
|
+
codeContainer.textContent = syntaxString;
|
|
79
80
|
var chartContainer = wrapperContainer.querySelector('.gpt-vis-wrapper-chart-container');
|
|
80
81
|
var downloadButton = wrapperContainer.querySelector('[data-action="download"]');
|
|
81
82
|
var copyButton = wrapperContainer.querySelector('[data-action="copy"]');
|