Hello Alessio,

I am not an expert of NiFi UI, but tried to find where to customize to
apply a default color.

Here is the Javascript function that creates new Processor instance by
sending a REST request to NiFi Web API:
https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/header/components/nf-ng-processor-component.js#L201

The processEntity object in the JS will be mapped to this DTO class in
NiFi server:
https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ProcessorDTO.java#L35

Current JS code doesn't specify any style, but if you add following
style property in the object, I think you can get what you'd like to:

'component': {
  'type': processorType,
  'name': name,
  'position': {
    'x': pt.x,
    'y': pt.y
  },
  'style': {background-color: "#853333"}
}

And you can embed color mapping to processorType, perhaps.

Hope this helps,
Koji

On Mon, Feb 6, 2017 at 5:01 PM, Alessio Palma
<[email protected]> wrote:
> Hello all,
> It's fact that each processor can be coloured; there is a way to set a custom 
> default color?
> What we need is to add a map into nifi configuration so that when a processor 
> is moved into the workbench it already has its own colour.
>
> So the question is how much complex is add this feature to nifi and where I 
> should look to make the changes.
>
> Thanks in advance.
>
> AP
>
>

Reply via email to