# \[DEV custom visualization\]. Only field of type "number" are shown in linput list

**URL:** <https://discuss.elastic.co/t/dev-custom-visualization-only-field-of-type-number-are-shown-in-linput-list/135503>\
**Category:** Kibana\
**Created:** [June 12, 2018, 9:53am UTC](https://discuss.elastic.co/t/dev-custom-visualization-only-field-of-type-number-are-shown-in-linput-list/135503 "2018-06-12T09:53:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco\_Strambelli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_strambelli/32/32161_2.png) [@Marco\_Strambelli](https://discuss.elastic.co/u/Marco_Strambelli)\
**Post date:** [June 12, 2018, 9:53am UTC](https://discuss.elastic.co/t/dev-custom-visualization-only-field-of-type-number-are-shown-in-linput-list/135503/1 "2018-06-12T09:53:43Z")

</div>

Hello all.  
I'm developing a custom visualization (Angular-Visualization).  
My gol is using the "top hit" aggregation and keep the last entry of a field of _type String_.

This is what happens: I select "top hit" as aggr but in the fields list only fields of type "number" are shown. Where are the string fields? .  
I tried to replicate the same thing on the core-visualization: data-table; over there it works.  
On the same index of course...

I posted 2 photo too.  
I'm in your hands. Ty.

 ![datatable_fields_list_all_type](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bbd5ca56a72ad4d14e79985917012dea780d1b74.PNG) ![fields_list_only_number_type](https://us1.discourse-cdn.com/elastic/original/3X/a/f/af799043bdc2a69080a8b13f4842fe4ffe009695.PNG)

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [June 12, 2018, 11:52am UTC](https://discuss.elastic.co/t/dev-custom-visualization-only-field-of-type-number-are-shown-in-linput-list/135503/2 "2018-06-12T11:52:08Z")

</div>

Hi Marco,

unfortunately, this hasn't been solved the best possible way, when this aggregation was introduced and is currently hard-coded to allow string values only for `table` and `metric` vis explicitly, see [`top_hit.js`](https://github.com/elastic/kibana/blob/master/src/ui/public/agg_types/metrics/top_hit.js#L44).

Please feel free to open a feature request for that on our repository, that we find a better way to let each vis configure that itself.

Sorry, for that news.

Cheers,  
Tim

---

<div class="post-metadata">

**Author:** ![Marco\_Strambelli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_strambelli/32/32161_2.png) [@Marco\_Strambelli](https://discuss.elastic.co/u/Marco_Strambelli)\
**Post date:** [June 12, 2018, 1:05pm UTC](https://discuss.elastic.co/t/dev-custom-visualization-only-field-of-type-number-are-shown-in-linput-list/135503/3 "2018-06-12T13:05:32Z")

</div>

Ty timroes.

I've specified the type: 'table'... still not working  
 ![custom_vis](https://us1.discourse-cdn.com/elastic/original/3X/1/d/1deb0610e5e9ac9093c8adcacd204ddcd9e4b8e9.PNG)

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [June 12, 2018, 3:11pm UTC](https://discuss.elastic.co/t/dev-custom-visualization-only-field-of-type-number-are-shown-in-linput-list/135503/4 "2018-06-12T15:11:28Z")

</div>

Hi,

you would actually need to switch the `name` of your visualization to table. That's the ID of the visualization. But that way you will most likely break a lot of stuff, since you are now sharing the same ID than a build in visualization, so the vis system randomly will use one of the two vis implementations to load that stored visualization. So you might end up having your implementation handle actual table vis and vice versa. That's not what you want, so unfortunately you cannot or should not overwrite those ids.

Also as a side note: we are not recommending using `createAngularVisualization` anymore if you are currently starting to develop. We are currently in the process of removing Angular from Kibana (though you will still be able to use it by including it in your own plugin), but once we progress on that way, we'll actually deprecate that method and hopefully for 7.0 already remove it.

Cheers,  
Tim

---

<div class="post-metadata">

**Author:** ![Marco\_Strambelli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_strambelli/32/32161_2.png) [@Marco\_Strambelli](https://discuss.elastic.co/u/Marco_Strambelli)\
**Post date:** [June 12, 2018, 4:02pm UTC](https://discuss.elastic.co/t/dev-custom-visualization-only-field-of-type-number-are-shown-in-linput-list/135503/5 "2018-06-12T16:02:13Z")

</div>

Can I suggest you to write this (Angular deprecation) on the documentation? 😅 .

Anyway. Thx.

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [June 12, 2018, 4:03pm UTC](https://discuss.elastic.co/t/dev-custom-visualization-only-field-of-type-number-are-shown-in-linput-list/135503/6 "2018-06-12T16:03:38Z")

</div>

We actually have removed that angular method from all documentations (for the recent versions) 🙂

Once we have a cleaner roadmap vision on when to remove it, we'll also put some deprecation warning into some developer documentation.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 10, 2018, 4:03pm UTC](https://discuss.elastic.co/t/dev-custom-visualization-only-field-of-type-number-are-shown-in-linput-list/135503/7 "2018-07-10T16:03:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
