lib/vega/spec.rb in vega-0.2.0 vs lib/vega/spec.rb in vega-0.2.1
- old
+ new
@@ -30,14 +30,14 @@
output = <<~EOS
#{html}
<script>
require.config({
paths: {
- 'vega': 'https://cdn.jsdelivr.net/npm/vega@5.21.0?noext',
- 'vega-util': 'https://cdn.jsdelivr.net/npm/vega-util@1.17.0?noext',
- 'vega-lite': 'https://cdn.jsdelivr.net/npm/vega-lite@5.1.1?noext',
- 'vega-embed': 'https://cdn.jsdelivr.net/npm/vega-embed@6.19.1?noext'
+ 'vega': 'https://cdn.jsdelivr.net/npm/vega@5.21.0/build/vega.min',
+ 'vega-util': 'https://cdn.jsdelivr.net/npm/vega-util@1.17.0/build/vega-util.min',
+ 'vega-lite': 'https://cdn.jsdelivr.net/npm/vega-lite@5.1.1/build/vega-lite.min',
+ 'vega-embed': 'https://cdn.jsdelivr.net/npm/vega-embed@6.19.1/build/vega-embed.min'
}
});
require(['vega', 'vega-util', 'vega-lite', 'vega-embed'], function(vega, vegaUtil, vegaLite, vegaEmbed) {
#{js}
});
@@ -50,9 +50,10 @@
def generate_output
id = "chart-#{SecureRandom.hex(16)}" # 2**128 values
width = @spec["width"].is_a?(Integer) ? "#{@spec["width"]}px" : "100%"
height = @spec["height"].is_a?(Integer) ? "#{@spec["height"]}px" : "300px"
+ height = "auto" if @spec["height"].nil?
# user can override with usermeta: {embedOptions: ...}
embed_options = {actions: false}
# html vars