How to decorate a parent node with background coloured title like a panel style with cytoscape.js - styles

I'm working with compound graphs library cytoscape.js for some days and familiar with its demo and basic APIs.
But I wonder if it is possible to decorate a parent node with style like the following screenshoot.
The defaults style of parent node is just a rectangle frame. Is it possible to render it with a background coloured title ?
Any help is greatly appreciated.

I finally resolve my issue with the following snippet.
{
selector: ':parent',
style: {
'background-image': function(){
return "title.jpg";
},
'padding-top' : '25px',
'background-position-x' : '0',
'background-position-y' : '0',
'background-width' : '100%',
'background-height' : '25px',
'background-fit' : 'contain',
}
}

Use a background image for the coloured title.

Related

Change color of selected TopTab border color

How can I change the color of this border.
I have tried using the following in options but that doesn't work.
topBar: {
borderColor: "white"
}
Which did try operation system ? ( Android / iOS ) (I'm using PhpStorm because I'm Full-Stack developer, highly recommend.) By selecting topBar you can go to the source with ctrl+b.
Options.ts
/**
* Change the navbar border color
* #### (Android specific)
*/
borderColor?: Color;
If not both, set the borderHeight. So like this; (from my code)
stack:{
children:[
{
component:{
name: 'app.Main.Shop',
options:{
topBar:{
borderColor:'blue',
borderHeight:2
},
},
}
}
],
options: {..}
}
Result like this;

Sublime 3 font size of definition hover

Is there a way to manage the font size of the function definition hover on ST3?
Here's what I see:
I've tried adding font.size to the theme for this element which is popup_control html_popup according to docs but it doesn't appear to accept this.
Update: I found that pasting this CSS in my color theme plist addresses the list/links but not the title. I have tried to use a plugin like ScopeHunter to find the context of the 'definitions' title but it doesn't work for popups.
<key>popupCss</key>
<string><![CDATA[
html {
background-color: #404238;
color: #F8F8F2;
}
a {
color: #66D9EF;
}
.error, .deleted {
color: #F92672;
}
.success, .inserted {
color: #A6E22E;
}
.warning, .modified {
color: #FD971F;
}
]]></string>
The best thing to do is look at the HTML that is used in the popup, to help decide what CSS selectors to use in the color scheme's popupCss to change the appearance of the popup.
In this case, the code is in Packages/Default/symbol.py, which you can view using https://packagecontrol.io/packages/PackageResourceViewer:
<body id=show-definitions>
<h1>Definition%s:</h1>
<p>
...
</p>
</body>
So you can use the following CSS in your popupCSS to target it and change the color of the "Definitions" text, for example - to prove the selector is working (the official recommendation is to use the id from the body tag):
#show-definitions h1 {
color: #b3bc20;
}
however, specifying the font-size seems to have no effect, at least in build 3154, so I think there is a bug in ST.

Kendo Angular 2 Grid Height

I want my grid to have a dynamic height. Before with angular 1 and kendo i would do like this.
<kendo-grid id="grid" options="entityGrid.gridOptions"></kendo-grid>
With the following CSS:
#grid {
height: calc(100% - 1em);
}
But with Kendo grid for angular2 when i try this it wont work.
<kendo-grid id="grid"
[data]="entityGrid?.view | async"
[scrollable]="'virtual'">
</kendo-grid>
When using scrolling (and static headers), the grid content area needs to have a height, too. Computing it dynamically based on the page is not supported at this time, and is not going to work with angular-universal. You can log this as a feature request on the kendo-angular2 repo, so that it is considered for implementation.
That said, you can use the following hack to make it work:
encapsulation: ViewEncapsulation.None,
styles: [
`kendo-grid {
height: calc(100% - 3em);
margin-top: 3em;
}
kendo-grid .k-grid-content {
height: calc(100% - 46px);
}`
],
This will pass the styles in the component itself. The value 46px is the size of the header, and 3em is your desired offset.
See this plunkr example for a working demo.
I was able to set dynamic height with following configuration
<kendo-grid class="grid"
[kendoGridGroupBinding]="data"
[ngStyle]="gridHeight"
</kendo-grid>
In TS file
public gridHeight = {
height: 'calc(100vh - 140px)'
};
You can set height as per your requirement from TS

How to wrap lengthy text in JointJs Rectangle

Can anyone tell me how to wrap lengthy text inside rectangle in JointJS.
Thanks in advance
You can use either "TextBlock" or if you trying to create a custom element you can write like this
joint.shapes.devs.testModel = joint.shapes.basic.TextBlock.extend( {
markup: ['<g class="rotatable"><g class="scalable"><rect class="body"/><rect class="leftthick"/></g>',
joint.env.test('svgforeignobject') ? '<foreignObject class="fobj"><body xmlns="http://www.w3.org/1999/xhtml"><div class="content"/></body></foreignObject>' : '<text class="content"/>',
'<image/><text class="label"/><g class="inPorts"/><g class="outPorts"/>',
'</g>'].join(''),
defaults: joint.util.deepSupplement({

Alloy proper way for tableviewrow color

I'm trying to set the color of my TableViewRow to red ( just for testing ).
The thing is that i create the tablerow dynamically with the following code:
$.mainData.appendRow(Ti.UI.createTableViewRow({ title: data[i].txt, uid: data[i].uid}));
My app.tss looks like this:
"TableViewRow":{
color: "#FF0000"
},
".testing": {
color: "#FF0000"
}
But the color isn't applied to the rows.
I even tried to append the class to the row with this line of code:
$.mainData.appendRow(Ti.UI.createTableViewRow({ title: data[i].txt, uid: data[i].uid, 'class': 'testing'}));
But that also didn't work.
The only way to make it work is like this:
$.mainData.appendRow(Ti.UI.createTableViewRow({ title: data[i].txt, uid: data[i].uid, color: "#FF0000"}));
But that just doesn't feel like it is the right way. How can i make it work with the .tss file like it should work?
You can create style from .tss classes. And apply them to the view. More here http://docs.appcelerator.com/titanium/3.0/#!/guide/Dynamic_Styles

Resources