te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>javascript - Does Vega-Lite provide all the features that Vega provides? - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Does Vega-Lite provide all the features that Vega provides? - Stack Overflow

programmeradmin2浏览0评论

I am trying to develop an interactive chart using Vega-Lite but I am not able to find any documentation that refers to interactive chart, mainly eventlisteners.

So, wanted to know if Vega-Lite has that capability.

Please help me here as I am a newbie and really need to develop an interactive chart preferably using Vega-Lite, if possible; otherwise I will go with Vega.

I am trying to develop an interactive chart using Vega-Lite but I am not able to find any documentation that refers to interactive chart, mainly eventlisteners.

So, wanted to know if Vega-Lite has that capability.

Please help me here as I am a newbie and really need to develop an interactive chart preferably using Vega-Lite, if possible; otherwise I will go with Vega.

Share Improve this question edited Aug 28, 2016 at 20:40 jakevdp 86.4k15 gold badges135 silver badges172 bronze badges asked Feb 9, 2016 at 23:50 JVMJVM 9941 gold badge11 silver badges23 bronze badges 6
  • Have you read this yet? – Robert Harvey Commented Feb 9, 2016 at 23:54
  • Yes, I did. I checked all the examples also but did not see a single example of interactive chart. – JVM Commented Feb 10, 2016 at 2:23
  • What you have here is a classic example of the Facade Pattern, a pattern designed to shield the user from much of the plexity of an API, in part by hiding those elements which the Facade creator deems too plex for ordinary uses. I consider it highly likely that, if EventListeners don't show up in the Vega-Lite documentation, that they're probably not supported. – Robert Harvey Commented Feb 10, 2016 at 2:47
  • My understanding is, event handling is pretty basic thing (e.g. hover or click event) considering it as a graphing and charting api. They have provided a piler also that piles the vega-lite specification to vega specification. I am not getting the purpose of creating vega-lite if such basic features have been suppressed. I did see that vega-lite uses intelligent defaults of lot of properties of Vega so why not handling events as well? – JVM Commented Feb 10, 2016 at 20:24
  • "Intelligent defaults" is probably not something you have to hook up, like an event. – Robert Harvey Commented Feb 10, 2016 at 21:12
 |  Show 1 more ment

3 Answers 3

Reset to default 10

No. Vega supports everything that vega-lite does, as vega-lite is piled into vega code. However, vega-lite does not support everything that vega does.

However, if you want to use vega-lite, but want to take advantage of a feature available only in vega (like interactivity), you can start with vega-lite code, convert it into vega code (the online vega editor allows this) and then continue editing the vega code.

Specifying interactivity in Vega-Lite will be possible as of some time in mid-2017. Here is the announcement, including a paper and a demo video: Vega-Lite: A Grammar of Interactive Graphics

As the accepted answer said: No. Let me provide examples:

  • SVG graphics support: You can't choose how to render your chart (image, svg) in Vega Lite.
  • Week timeunit support: You can set timeunit to "week" only in Vega, this missing property is particularly frustrating.
  • Select drop-down lists: Adding drop down lists that update chart upon selection are available only in Vega.
  • Some Donut chart styling properties: Vega privdes more options to customize the look of the Donut chart.
发布评论

评论列表(0)

  1. 暂无评论