Vega-Lite: Add a layer to a multi view plot based on an if-condition - kibana

I'm trying to build a simple text only dashboard with Kibana based on responses like the one below
{
"_index": "jenkins-plasma4-2022.04.08-000001",
"_type": "_doc",
"_id": "nhKIQYABmFVLYNIVp4H3",
"_score": 0,
"_source": {
"branch": "trunk",
"status": "UNSTABLE",
"buildnumber": 5501,
"failedStages": ["System Test"],
"suspectedCommits": []
}
I'm using vconcat right now:
"vconcat": [
{
"mark": {"type": "text", "fontSize": 50},
"encoding": {
"text": {"field": "buildnumber", "type": "nominal",}
}
},
{
"mark": {"type": "text", "fontSize": 50},
"encoding": {
"text": {"field": "status", "type": "nominal",}
}
}
]
In some situations "suspectedCommits" will not be empty, in those cases I'd like to be able to add to a multi view visualization

Related

Display just one number in Vega/Kibana

I'm trying to create a query/display that just shows a single number. I've had to do it in vega because the query involves a number of queries, then transforms involving timedeltas to merge the data together.
In my browser developer tools I can see that the data is coming through.
All I'm after here is days here is my marks section in vega:
"marks": [
{
"type": "text",
"from": { "data": "results" },
"properties": {
"enter": {
"text": "days",
"x": {"value": 10},
"y": {"value": 10},
"fill": {"value": "red"},
"fillOpacity": {"value": 1},
"fontSize": {"value": 100}
},
"update": {
"text": "days",
"x": {"value": 10},
"y": {"value": 10},
"fill": {"value": "red"},
"fillOpacity": {"value": 1},
"fontSize": {"value": 100}
}
}
}
]
I have also tried { "field": "days" } instead of "days" along with a good few attempts to change the x,y and fills etc.
I get no errors in the browser and the visualization is just blank.
Does anyone know what I'm doing wrong here?
A bit late, but I'm just facing the same situation right now.
I've managed to put up a minimal working example using Vega-Lite; not sure it is exactly as it is supposed to be, but at least it is working. You can check it out here.
The code is the following:
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"values": [
{"a": 28}
]
},
"encoding": {
"text": {
"field": "a",
"type": "quantitative"
}
},
"mark": {
"type": "text",
"fill": "red",
"fontSize": 100,
"fillOpacity": 1,
"x": 10,
"y": 10
},
"config": {
"view": {
"stroke": "transparent"
}
}
}
A couple of remarks on the code:
I'm using your example's fill, fontSize, fillOpacity, x and y options; they could be different or even not be there.
When displaying just text, the "container" of the visualization can be seen as a small box surrounding the text in a light gray by default. The "stroke": "transparent" config option is what gets rid of this box.
I'm pretty new to Vega (just started some minutes ago), so my apologies in advance for any possible conceptual errors.
Edit
Looking pretty good in Kibana so far :)

How to get bold text in the title in CardAction

Is it possible to get bold text in the title of a CardAction() in bot framework v4? I'm using it in a HeroCard. I've tried ** Option One ** but it only works in the text of a HeroCard for example, but not in the CardAction() buttons.
Here's my implementation of CardActions in a HeroCard:
var Options = new HeroCard
{
Text = "What do you choose?",
Buttons = new List<CardAction>
{
new CardAction() { Title = "Option One, Type = ActionTypes.ImBack, Value = ""Option One" },
new CardAction() { Title = "Go back", Type = ActionTypes.ImBack, Value = "Go back" },
},
};
You can't. It's up to each channel to determine how to display cards.
Alternatively, you can try using an Adaptive Card with something like the following JSON:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "What do you choose?"
},
{
"type": "Container",
"items": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Option One",
"weight": "Bolder",
"horizontalAlignment": "Center",
"size": "Large",
"color": "Accent"
}
],
"selectAction": {
"type": "Action.Submit"
},
"id": "optionOne",
"style": "default"
},
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Go back",
"horizontalAlignment": "Center",
"size": "Large",
"weight": "Bolder",
"color": "Accent"
}
],
"selectAction": {
"type": "Action.Submit",
"data": "goBack"
},
"id": "goBack",
"style": "default"
}
],
"style": "emphasis"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
Again, though, it will be up to the channel for how it wants to display "weight": "Bolder"

how do you do nested objects in graphql - i'm using appsync and dynamodb

I have the following object and I want to create a schema for it that handles nested objects - what's the best way using graphql:
{
"type": "product",
"id": "411e2a2b-37e8-421e-adb8-2e038751d263",
"name": "Hazel",
"slug": "hazel",
"sku": "ENGINEERED3",
"manage_stock": false,
"description": "Abstract, sculptural, refined and edgy with a modern twist. Its symmetrical, spoked structure generates a clever geometric presence, which works well in a contemporary environment..",
"price": [
{
"amount": 11200,
"currency": "AUD",
"includes_tax": true
}
],
"status": "live",
"commodity_type": "physical",
"meta": {
"timestamps": {
"created_at": "2019-05-09T13:30:10+00:00",
"updated_at": "2019-05-09T13:45:11+00:00"
},
"display_price": {
"with_tax": {
"amount": 11200,
"currency": "AUD",
"formatted": "$112.00"
},
"without_tax": {
"amount": 11200,
"currency": "AUD",
"formatted": "$112.00"
}
},
"stock": {
"level": 0,
"availability": "out-stock"
}
}
}
It seems as though graphql wants a separate type per nested object - is that true?

Sylius ShopApiPlugin Can't add products to cart

I'am trying to add a product to my cart using the ShopApiPlugin made for Sylius.
When I try to add a product thru /carts/mytokenoid/items with the json body
{
"productCode": "iphone9",
"quantity": 5
}
I get this response
{
"tokenValue": "mytokenoid",
"channel": "US_WEB",
"currency": "EUR",
"locale": "en_US",
"checkoutState": "cart",
"items": [
{
"quantity": 5,
"total": 4800,
"product": {
"code": "iphone9",
"name": "iPhone 9",
"slug": "iphone-9",
"averageRating": 0,
"taxons": {
"others": []
},
"variants": [
{
"code": "iphone9",
"axis": [],
"nameAxis": [],
"price": {
"current": 2000,
"currency": "EUR"
},
"images": []
}
],
"attributes": [],
"associations": [],
"images": []
}
}
],
"totals": {
"total": 6896,
"items": 4800,
"taxes": 0,
"shipping": 2096,
"promotion": -5200
}, (...)
But when I do /shop-api/carts/mytokenoid to check my cart content, it is empty, nothing was added. Also I checked the database and the cart is there with the correct token but no items.
Does anyone know how can I solve this? I already tried with authorization token and without. Got the same thing
Found the solution.
You just have to uncomment the "- tactician.middleware.doctrine" line in the config/packages/league_tactician.yaml

Open graph fitness.runs returning no data

I have a bunch of Nike+ run data which i'm assuming (based on the below article) is published to the open graph. It certainly looks that way in my timeline.
https://developers.facebook.com/blog/post/2012/08/29/early-success-stories--fitness-and-open-graph/
Frustratingly while my music.listens request works fine and returns all of my Spotify listens, my request for fitness.runs returns no data. Is this simply because Nike haven't integrated correctly with the Open Graph. Or perhaps I need to request extended permissions in my Auth token?
https://developers.facebook.com/docs/reference/opengraph/action-type/fitness.runs
Any ideas?
As with all actions you need the correct permissions, in this case
user_actions.fitness
So the data returned from /me/fitness.runs for Nike will look like
{
"data": [
{
"id": "10101118696330517",
"from": {
"name": "Philippe Harewood",
"id": "13608786"
},
"start_time": "2013-03-22T23:15:56+0000",
"end_time": "2013-03-22T23:26:36+0000",
"publish_time": "2013-03-24T15:50:00+0000",
"application": {
"name": "Nike",
"namespace": "nikeapp",
"id": "84697719333"
},
"data": {
"course": {
"id": "476811255725972",
"url": "http://nikeplus.nike.com/plus/activity/running/detail/2118587303?external_share_id=CE32E1C4-93D8-48A7-A08F-6D5B4C13EE6A&is_new_meta=true",
"type": "fitness.course",
"title": "1.12 miles"
}
},
"type": "fitness.runs",
"no_feed_story": false,
"likes": {
"count": 0,
"can_like": true,
"user_likes": false
},
"comments": {
"count": 0,
"can_comment": true,
"comment_order": "chronological"
}
},
{
"id": "10101118696155867",
"from": {
"name": "Philippe Harewood",
"id": "13608786"
},
"start_time": "2013-03-19T22:03:32+0000",
"end_time": "2013-03-19T22:18:37+0000",
"publish_time": "2013-03-24T15:49:46+0000",
"application": {
"name": "Nike",
"namespace": "nikeapp",
"id": "84697719333"
},
"data": {
"course": {
"id": "502469216483599",
"url": "http://nikeplus.nike.com/plus/activity/running/detail/2118587302?external_share_id=EBF6BC1D-BDEA-4EE5-B18D-FBC576610F13&is_new_meta=true",
"type": "fitness.course",
"title": "1.49 miles"
}
},
"type": "fitness.runs",
"no_feed_story": false,
"likes": {
"count": 0,
"can_like": true,
"user_likes": false
},
"comments": {
"count": 0,
"can_comment": true,
"comment_order": "chronological"
}
}
],
"paging": {
"next": "https://graph.facebook.com/13608786/fitness.runs?limit=25&offset=25&__after_id=10101118696155867"
}
}

Resources